Skip to content

Fix/amd session resume link v2 - #4

Merged
raunak-cispl1 merged 8 commits into
mainfrom
fix/amd-session-resume-link-v2
Nov 17, 2026
Merged

raunak-cispl1 merged 8 commits into
mainfrom
fix/amd-session-resume-link-v2

Conversation

@saburali-codeclouds

@saburali-codeclouds saburali-codeclouds commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes the three review points.

  • ?amd_session= link: the code now restores the visitor's answers, as the README says.
  • Cookie: amd_php_session renamed to amd_sid. Nobody is logged out, because it only holds the CSRF token.
  • STATUS.md: deleted, along with every link to it.
  • Also: new sessions are saved right away, traffic-source tracking added, encrypted _amd links supported, and stale sessions replaced.
    Remove LAMP-port references from comments

- SessionResolver adopts a `?amd_session=<uuid>` resume link, restores the
  stored journey (intake answers included) and re-issues the cookie.
- A freshly minted session now inserts its row, so its first-touch
  attribution and `reconciled` flag are stored, and records
  `session_created` with its source category.
- Attribution: canonical tracking keys and vendor aliases
  (AttributionNormalizer), derived source/device/browser/OS
  (DerivedAttribution), and `_amd` payload decryption with key rotation
  (AmdPayload, keys from AMD_TRACKING_KEY / AMD_TRACKING_KEY_PREVIOUS).
- Cookie branch reads an unreconciled journey against the EMR once and
  re-mints a session the EMR no longer recognises, carrying the journey.
- /health reports whether the tracking keys are configured (presence only).
It holds only the CSRF token and short-lived counters, and MemoryStore already
drops every session on restart, so the rename logs nobody out. Journey state
stays under the separate amd_session cookie.
CI runs type-check, lint, tests, build, the asset build and
config:validate on Node 22 and 24. config/channel.generated.ts is
gitignored, so a fresh clone could not compile; the example file gives
it an empty shape to copy.
The factory declared an unused nullReporter parameter that its inject
list did not, so every later argument shifted by one and
instrumentation received the verification gateway. GET /checkout/
answered 500.
Drop the porting-plan phase labels and PHP/Kysely history from code
comments, docs and test descriptions so they describe the Node
storefront as it is.

- Strip "(Phase N)" labels and "Phase N's done bar" wording from
  src, config, prisma schema, views and test files; rewrite the
  phase-ordered JourneyState doc comment as a per-subsystem list.
- Replace PHP-isms in comments (PDO driver note, array_keys($payload))
  with their Node equivalents or remove them.
- Drop references to the earlier Kysely persistence layer and the
  porting plan's "Corrections found during implementation" notes.
- Remove the storefront-lamp link from docs/STACK.md.
- Reword "this port" comments in intake-upload.controller.ts and
  reverse-reconciliation.ts to describe current behaviour.

Comment and test-title changes only; no runtime behaviour changes.
@saburali-codeclouds
saburali-codeclouds force-pushed the fix/amd-session-resume-link-v2 branch from 3c4a3be to eed46ac Compare November 17, 2026 07:38
@raunak-cispl1
raunak-cispl1 merged commit 0b14329 into main Nov 17, 2026
2 checks passed
@raunak-cispl1
raunak-cispl1 deleted the fix/amd-session-resume-link-v2 branch November 17, 2026 11:28
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.

2 participants