Skip to content

fix(devtoberfest): add missing EventRegistrations HANA sequence (#1600) - #1602

Merged
jung-thomas merged 1 commit into
mainfrom
worktree-fix-1600-eventreg-seq
Aug 10, 2026
Merged

jung-thomas merged 1 commit into
mainfrom
worktree-fix-1600-eventreg-seq

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Fixes #1600 — 500 error when registering for Devtoberfest (DEV + PROD).

Root cause

POST /api/devtoberfest/join (srv/routes/devtoberfest-auth.js) calls getNextLegacyId('EventRegistrations', db). On HANA that runs:

SELECT "COM_SAP_DEVELOPERS_IMS_EVENTREGISTRATIONS_SEQ".NEXTVAL FROM DUMMY

But that .hdbsequence artifact was never created. EventRegistrations is in the VALID_ENTITIES allowlist in srv/lib/legacy-id.js, yet unlike all 30+ sibling entities it had no db/src/*_SEQ.hdbsequence file. The NEXTVAL query throws → the handler's catch returns 500 INTERNAL. Environment-independent, which matches the DEV + PROD reports.

Unit tests passed because the SQLite path in getNextLegacyId uses an in-memory counter, never the sequence — so the HANA-only gap was invisible to npm test.

Fix

  • Add db/src/COM_SAP_DEVELOPERS_IMS_EVENTREGISTRATIONS_SEQ.hdbsequence (identical shape to every sibling sequence).
  • Add EventRegistrations to the test/hybrid/hana-sequences.test.js deployed-sequence list so the regression is guarded.

Deploy note

This introduces a new HDI artifact, so it requires a DB module deploy (not backend-only) to create the sequence in the HDI container before the join endpoint recovers.

Test

  • test/unit/devtoberfest-join-handler.test.js — 9 passed.
  • Hybrid hana-sequences.test.js now asserts the new sequence resolves NEXTVAL (requires cf login, run in CI/hybrid).

The join handler calls getNextLegacyId('EventRegistrations') which on
HANA does SELECT NEXTVAL from COM_SAP_DEVELOPERS_IMS_EVENTREGISTRATIONS_SEQ.
That .hdbsequence artifact was never created — every other entity in
legacy-id.js's VALID_ENTITIES allowlist has one. The missing sequence made
the NEXTVAL query throw, so POST /api/devtoberfest/join returned 500 on
every environment (DEV + PROD). Unit tests passed because SQLite uses an
in-memory counter, not the sequence.

Add the sequence file (mirrors all sibling _SEQ artifacts) and add
EventRegistrations to the hybrid hana-sequences regression test.
@jung-thomas
jung-thomas merged commit d40a818 into main Aug 10, 2026
4 checks passed
@jung-thomas
jung-thomas deleted the worktree-fix-1600-eventreg-seq branch August 10, 2026 20: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.

Devtoberfest - can't register

1 participant