Skip to content

Commit

Permalink
fix: deleted_at not saved in UTC tz
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]>
  • Loading branch information
cameri committed Jan 16, 2023
1 parent dbf8a7f commit 297a07e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/repositories/event-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export class EventRepository implements IEventRepository {
event_signature: pipe(always(''), toBuffer),
event_delegator: always(null),
event_deduplication: pipe(always([pubkey, 5]), toJSON),
deleted_at: always(date),
deleted_at: always(date.toISOString()),
})
)
)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/repositories/event-repository.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ describe('EventRepository', () => {
it('insert stubs by pubkey & event ids', () => {
const query = repository.insertStubs('001122', ['aabbcc', 'ddeeff']).toString()

expect(query).to.equal('insert into "events" ("deleted_at", "event_content", "event_created_at", "event_deduplication", "event_delegator", "event_id", "event_kind", "event_pubkey", "event_signature", "event_tags") values (\'1970-01-20 03:57:15.425\', \'\', 1673835, \'["001122",5]\', NULL, X\'aabbcc\', 5, X\'001122\', X\'\', \'[]\'), (\'1970-01-20 03:57:15.425\', \'\', 1673835, \'["001122",5]\', NULL, X\'ddeeff\', 5, X\'001122\', X\'\', \'[]\') on conflict do nothing')
expect(query).to.equal('insert into "events" ("deleted_at", "event_content", "event_created_at", "event_deduplication", "event_delegator", "event_id", "event_kind", "event_pubkey", "event_signature", "event_tags") values (\'1970-01-20T08:57:15.425Z\', \'\', 1673835, \'["001122",5]\', NULL, X\'aabbcc\', 5, X\'001122\', X\'\', \'[]\'), (\'1970-01-20T08:57:15.425Z\', \'\', 1673835, \'["001122",5]\', NULL, X\'ddeeff\', 5, X\'001122\', X\'\', \'[]\') on conflict do nothing')
})
})

Expand Down

0 comments on commit 297a07e

Please sign in to comment.