Skip to content

Commit

Permalink
fix delivery failure of Create, Delete and Update activities
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed May 6, 2024
1 parent 0b70f88 commit 082c99c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion outbox/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func Create(ctx context.Context, domain string, cfg *cfg.Config, log *slog.Logge
return fmt.Errorf("failed to insert note: %w", err)
}

if _, err = tx.ExecContext(ctx, `insert into outbox (activity, sender) values(?,?)`, j, author.ID); err != nil {
if _, err = tx.ExecContext(ctx, `insert into outbox (activity, sender) values(?,?)`, string(j), author.ID); err != nil {
return fmt.Errorf("failed to insert Create: %w", err)
}

Expand Down
2 changes: 1 addition & 1 deletion outbox/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func Delete(ctx context.Context, domain string, cfg *cfg.Config, log *slog.Logge
if _, err := tx.ExecContext(
ctx,
`INSERT INTO outbox (activity, sender) VALUES (?,?)`,
j,
string(j),
note.AttributedTo,
); err != nil {
return fmt.Errorf("failed to insert delete activity: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion outbox/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func UpdateNote(ctx context.Context, domain string, cfg *cfg.Config, log *slog.L
if _, err := tx.ExecContext(
ctx,
`INSERT INTO outbox (activity, sender) VALUES(?,?)`,
j,
string(j),
note.AttributedTo,
); err != nil {
return fmt.Errorf("failed to insert update activity: %w", err)
Expand Down

0 comments on commit 082c99c

Please sign in to comment.