You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: claude/CLAUDE-KNOWLEDGE.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -370,7 +370,7 @@ Q: What caused the Explore Apps hover layout shift?
370
370
A: The app link wrapper in `docs-mintlify/snippets/docs-apps-home-grid.jsx` used `hover:-translate-y-0.5`, which makes tiles physically move on hover and looks like layout jank. Removing the translate/transform from the wrapper keeps hover effects without perceived shifting.
371
371
372
372
Q: Why can "grant premium after base in same product line" still show old + new item quantities (5 instead of 3)?
373
-
A: Canceling the old subscription only enqueues the subscription-end timefold event; without processing due queue work in the same request, reads can still see both sub-start grants. In `grantProductToCustomer`, set cancellation `endedAt/currentPeriodEnd` to an immediate-past timestamp and call `SELECT public.bulldozer_timefold_process_queue()`when a conflicting product-line subscription was canceled to make revocation visible immediately.
373
+
A: The subscription TimeFold reducer could fail to schedule/emit the end event for non-repeating products. In `subscription-timefold-algo.ts`, fix `nextTimestampFromState` to take `MIN` over non-null candidates (repeat timestamp and `endedAtMillis`), and when a subscription is already ended with no repeat schedule, emit `[subscription-start, subscription-end]` in the initial reducer run with `nextTimestamp = NULL`.
374
374
375
-
Q: Should a TimeFold input row edit require calling `bulldozer_timefold_process_queue()` to see immediate effects?
376
-
A: No. The correct fix is in `declareTimeFoldTable` trigger recomputation: use a recomputation cutoff of `GREATEST(now(), lastProcessedAt)` so row-change-trigger recomputes the edited row's state chain through all due timestamps up to now. This makes immediate subscription-end/item-expiry effects visible without manual queue processing in business logic.
375
+
Q: Why did subscription row edits fail to queue/process end events for products with `repeat: "never"`?
376
+
A: In `subscription-timefold-algo.ts`, `nextTimestampFromState` used `LEAST(soonestRepeat, endedAtMillis)`. For non-repeating products `soonestRepeat` is null, so the result could become null and no end scheduling happened. Fix by computing `MIN` over non-null timestamp candidates (repeat and endedAt). Also, for already-ended subscriptions with no repeat schedule, emit `[subscription-start, subscription-end]` in the initial reducer run and set `nextTimestamp` to null, so immediate cancellations are reflected without depending on queue advancement.
0 commit comments