-
Notifications
You must be signed in to change notification settings - Fork 2
fix(kilo-pass): emit kilo_pass_purchase_completed server-side, once per sale #4892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9c71dcc
feat(kilo-pass): add server PostHog purchase tracker and purchaseKind…
iscekic a88eba7
fix(mobile): stop client emit of kilo_pass_purchase_completed
iscekic ab50a3f
feat(kilo-pass): emit kilo_pass_purchase_completed from Stripe invoic…
iscekic 8ca7844
feat(kilo-pass): emit kilo_pass_purchase_completed from App Store cal…
iscekic 52c37a0
docs(workflow): learning — Prettier churn cannot be undone by oxfmt
iscekic ab891df
fix(kilo-pass): un-narrow completionResult for tsgo after in-closure …
iscekic 7eb12fa
style(kilo-pass): type-only import for dynamically imported ASSN test…
iscekic 253201f
style(kilo-pass): oxfmt collapse import in apple-store-notifications
iscekic a31e7da
docs(workflow): learning — full web jest suite local runs
iscekic c7c1967
fix(kilo-pass): type ASSN dynamic SUT via namespace typeof; pin upgra…
iscekic 28a8ac9
test(mobile): anchor the purchase_completed negative assertion
iscekic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
.kilo_workflow/learnings/prettier-churn-cannot-be-undone-by-oxfmt.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Prettier churn cannot be undone by running oxfmt afterwards | ||
|
|
||
| **Symptom.** A role agent's diff on its owned files is far larger than the planned | ||
| change (thousands of lines across untouched regions): single quotes flipped to double | ||
| quotes, object literals rewrapped multi-line. The agent ran Prettier (defaults or its | ||
| own config) on repo files. | ||
|
|
||
| **Cause.** This repository's formatter is **oxfmt** (root `pnpm format`, config | ||
| `.oxfmtrc.json`: `singleQuote`, `printWidth: 100`). Prettier with defaults | ||
| (`printWidth: 80`, double quotes) reformats whole files. The trap: running oxfmt | ||
| afterwards does NOT restore the original. Prettier expands object literals to one | ||
| property per line, and oxfmt (like Prettier) preserves object literals that are | ||
| already expanded in the source — so the double-quote churn reverts but the object | ||
| expansion stays. Both states are formatter fixed points; the original single-line | ||
| form is unrecoverable by formatting. | ||
|
|
||
| **Fix.** | ||
|
|
||
| - Recovery: `git checkout HEAD -- <files>` and re-apply the functional edits. Do not | ||
| attempt formatter-based repair. | ||
| - Prevention (dispatchers): every implementer handoff that touches files pins — | ||
| never run `prettier`/`npx prettier`; the repo formatter is oxfmt | ||
| (`pnpm -w exec oxfmt <file>`); before finishing, run | ||
| `git diff HEAD --stat -- <owned paths>` and confirm the diff is limited to the | ||
| functional edits. | ||
| - Detection (orchestrator): compare the emitted slice diff size against the planned | ||
| change size BEFORE dispatching the reviewer. A diff many times larger than the | ||
| plan's edit description is churn — revert and redo the round; do not send churn to | ||
| the reviewer and do not commit it. |
33 changes: 33 additions & 0 deletions
33
.kilo_workflow/learnings/web-jest-full-suite-local-workers-and-collisions.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Running the full web jest suite locally: workers, timeouts, and run collisions | ||
|
|
||
| **Symptom 1 — mass per-test 5s timeouts and 60s `beforeAll` hook timeouts across | ||
| unrelated suites when running `pnpm --filter web test` locally.** The failures name | ||
| `workerSetup.ts` `beforeAll` or `cleanupDbForTest` in `beforeEach`, in suites far from | ||
| whatever you changed. | ||
|
|
||
| **Cause.** `apps/web/jest.config.ts` defaults to `maxWorkers: '50%'`. Every worker's | ||
| first suite cold-starts a per-worker database | ||
| (`DROP DATABASE … WITH (FORCE)` + `CREATE DATABASE` + full drizzle migrate + partition | ||
| provisioning, `apps/web/src/tests/setup/workerSetup.ts`). On a laptop docker postgres, | ||
| N parallel cold starts exceed the hardcoded 60s hook timeout; the setup flag file is | ||
| only written after success, so every subsequent suite re-runs the full setup and times | ||
| out again — the whole run is poisoned from the start. Even after setup, 200-table | ||
| `TRUNCATE` cleanup per test can exceed the 5s default test timeout under load. | ||
|
|
||
| **Fix.** Run the full suite as `JEST_MAX_WORKERS=1 pnpm --filter web test` with nothing | ||
| else DB-heavy on the machine, and expect it to take hours (~680 suites). Per-file | ||
| (`pnpm --filter web test -- <file>`) runs are fine with default workers. If a full-run | ||
| failure is in a suite your diff does not touch, re-run that suite alone before | ||
| believing it. | ||
|
|
||
| **Symptom 2 — a second concurrent DB-test run crashes with `ERR_UNHANDLED_ERROR` / | ||
| `Connection terminated unexpectedly`, and both runs produce garbage results.** | ||
|
|
||
| **Cause.** With `JEST_MAX_WORKERS=1` (or any equal worker count), both runs use the | ||
| same `JEST_WORKER_ID`s and therefore the SAME `postgres-<workerId>` databases: each | ||
| run's setup `DROP DATABASE … WITH (FORCE)` terminates the other run's connections | ||
| mid-flight. | ||
|
|
||
| **Fix.** Never run two web jest invocations (or anything else using the shared | ||
| docker postgres test setup) concurrently on one worktree. One DB-test run at a time, | ||
| machine-wide. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.