Skip to content

fix(addie): stabilize upcoming event day count#5233

Merged
bokelley merged 1 commit into
3.0.xfrom
fix-3-0-member-event-rounding
May 31, 2026
Merged

fix(addie): stabilize upcoming event day count#5233
bokelley merged 1 commit into
3.0.xfrom
fix-3-0-member-event-rounding

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • match main's upcoming-event day calculation by rounding the day delta instead of flooring it
  • add a 3.0.x changeset so the release PR consumes the source fix cleanly

Verification

  • npx vitest run server/tests/unit/member-context.test.ts --pool=threads
  • precommit: unit tests, dynamic import lint, typecheck
  • pre-push: version sync, Mintlify broken-link check

@aao-release-bot aao-release-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Clean backport of main's Math.round fix at server/src/addie/member-context.ts:1567 into the 3.0.x line — addresses the sub-millisecond drift that flipped "in 5 days" to "in 4 days" on the boundary.

Things I checked

  • origin/main:server/src/addie/member-context.ts:1565 already uses Math.round with the explanatory comment — the source line in this backport matches.
  • Sibling block at :1556 (last_published_at → "X days ago") correctly stays on Math.floor. "Elapsed time since" floors naturally; "time until" rounds. No inconsistency.
  • Patch-level changeset is the right shape: prompt-string rendering only, no wire or schema surface touched. Filename is descriptive.
  • Behavior change is bounded to the prompt string: events 13–24h out now render as "in 1 day" instead of "in 0 days," and events <12h in the past render as "in 0 days" instead of "in -1 days." Acceptable for a prompt fragment; no contract impact.

Follow-ups (non-blocking — file as issues)

  • Backport drops the three-line explanatory comment that exists on main (origin/main:server/src/addie/member-context.ts:1557-1559). Carry it forward so a future reader doesn't wonder why this site rounds and the sibling floors, and revert the wrong one.
  • No regression test landed with the backport. If main has a boundary-pinning test for this site, bring it across to 3.0.x so the line can't silently regress again.

Minor nits (non-blocking)

  1. Changeset prose. .changeset/member-event-days-rounding.md leads with release mechanics ("Match the 3.1 line's..."). Something closer to "Round upcoming-event day count to nearest day so events exactly N days out don't intermittently render as N-1" describes the user-visible fix more directly. Non-blocking.

code-reviewer: sound-with-caveats (caveats are the dropped comment and missing test backport — both Follow-ups, not blockers).

LGTM. Follow-ups noted below.

@bokelley bokelley merged commit 6e4dfdd into 3.0.x May 31, 2026
10 checks passed
@bokelley bokelley deleted the fix-3-0-member-event-rounding branch May 31, 2026 23:00
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