Skip to content

Mark giveaway BON notifications as read after settlement - #24

Merged
maghuro merged 9 commits into
mainfrom
feature/bon-notification-read-cleanup
Sep 29, 2026
Merged

maghuro merged 9 commits into
mainfrom
feature/bon-notification-read-cleanup

Conversation

@maghuro

@maghuro maghuro commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Summary

Adds best-effort cleanup of unread DarkPeers BON gift notifications created during a completed giveaway.

Safety / scope

  • uses UNIT3D's own per-notification CSRF-protected PATCH form instead of the mass-update route;
  • touches only unread Has Gifted You … BON notifications whose timestamp overlaps the giveaway window;
  • scans first, mutates afterwards so pagination does not shift while collecting targets;
  • validates same-origin/current-user notification URLs before submitting;
  • runs only after settlement reaches phase=complete and stopGiveaway() succeeds;
  • fire-and-forget: cleanup is deliberately not awaited, so HTTP/CSRF/notification failures cannot block, retry, or roll back giveaway settlement;
  • disabled in Rehearsal / Debug mode.

The cleanup is bounded to six notification pages and processes PATCH requests in small batches.

Validation

  • bumps BONanza to 1.5.12;
  • updates the generated userscript from the split source;
  • adds hardening assertions covering scope, no mass-update use, and non-blocking call order.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 37fea3e1b5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread userscripts/giveaway/src/00-preamble.js
Comment thread userscripts/giveaway/src/09-sponsorship-polling.js Outdated
Comment thread userscripts/giveaway/src/09-sponsorship-polling.js Outdated

maghuro commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Addressed all Codex findings:

  • updated the pinned hardening assertion to 1.5.12;
  • notification cleanup now prefers the UTC-scale timestamp interpretation already used by the DarkPeers calibration path, with browser-local time only as fallback;
  • timestamp resolution extends only the notification's represented interval and no longer extends the giveaway cutoff;
  • added regression assertions for both timestamp rules and rebuilt the generated userscript.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 230cbe2f29

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@maghuro
maghuro merged commit 302a839 into main Sep 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant