fix: handle expired scheduled event links & fix test suite setup #73

Merged
cadence merged 3 commits from beanie/out-of-your-element:bugfix/handle-expired-events into main 2026-03-08 22:11:29 +00:00
Contributor

This PR addresses a bridge crash discovered while backfilling old channels, alongside a wee QoL fix for the test suite.

  • Expired Events (d2m): Wraps Discord scheduled event/invite link lookups in a try-catch block. If a link is expired (404 or Discord error 10006), the bridge now posts a fallback m.notice rather than throwing an error and halting message conversion.
  • Test Suite Setup: Updates test.js to initialize the mock registration object using getTemplateRegistration() preventing test runner crashes when running without a local registration.yaml file.
This PR addresses a bridge crash discovered while backfilling old channels, alongside a wee QoL fix for the test suite. * **Expired Events (`d2m`):** Wraps Discord scheduled event/invite link lookups in a try-catch block. If a link is expired (404 or Discord error 10006), the bridge now posts a fallback `m.notice` rather than throwing an error and halting message conversion. * **Test Suite Setup:** Updates `test.js` to initialize the mock registration object using `getTemplateRegistration()` preventing test runner crashes when running without a local `registration.yaml` file.
beanie added 2 commits 2026-03-02 02:31:13 +00:00
Wrap the scheduled event lookup in a try-catch block to prevent the
bridge from crashing when it encounters expired or invalid links.
When a 404 or Discord error code 10006 is caught, the bot now
generates a fallback "m.notice" event to inform Matrix users that
the event link has expired.
Running the test suite without a local `registration.yaml` previously
caused a TypeError because the `reg` export defaulted to null. This
injects a base template using `getTemplateRegistration` before applying
test-specific overrides.
beanie force-pushed bugfix/handle-expired-events from 54dad027e6 to 6553946b88 2026-03-02 02:39:35 +00:00 Compare
cadence added 1 commit 2026-03-08 22:09:49 +00:00
cadence merged commit f5ee130463 into main 2026-03-08 22:11:29 +00:00
beanie deleted branch bugfix/handle-expired-events 2026-03-08 22:59:30 +00:00
Sign in to join this conversation.
No description provided.