summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-02-16 01:29:02 -0500
committerHazelnoot <acomputerdog@gmail.com>2025-02-16 19:14:58 -0500
commit3ab310e4727f04a2c2f17ef3881075dbe1daf5cb (patch)
tree83cb77169c0a8b727f7e023ca00d3193b3d9a08d
parentmerge: Merge upstream 2025.2.0 (!886) (diff)
downloadsharkey-3ab310e4727f04a2c2f17ef3881075dbe1daf5cb.tar.gz
sharkey-3ab310e4727f04a2c2f17ef3881075dbe1daf5cb.tar.bz2
sharkey-3ab310e4727f04a2c2f17ef3881075dbe1daf5cb.zip
relax validation of Announce(Note) timestamps
-rw-r--r--packages/backend/src/core/activitypub/ApInboxService.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/backend/src/core/activitypub/ApInboxService.ts b/packages/backend/src/core/activitypub/ApInboxService.ts
index 278c97f907..1eef85aeef 100644
--- a/packages/backend/src/core/activitypub/ApInboxService.ts
+++ b/packages/backend/src/core/activitypub/ApInboxService.ts
@@ -363,10 +363,12 @@ export class ApInboxService {
this.logger.info(`Creating the (Re)Note: ${uri}`);
const activityAudience = await this.apAudienceService.parseAudience(actor, activity.to, activity.cc, resolver);
- const createdAt = activity.published ? new Date(activity.published) : null;
+ let createdAt = activity.published ? new Date(activity.published) : null;
- if (createdAt && createdAt < this.idService.parse(renote.id).date) {
- return 'skip: malformed createdAt';
+ const renoteDate = this.idService.parse(renote.id).date;
+ if (createdAt && createdAt < renoteDate) {
+ this.logger.warn(`Correcting invalid publish time for Announce "${uri}"`);
+ createdAt = renoteDate;
}
await this.noteCreateService.create(actor, {