Skip to content

Conversation

@Ganeshswaminathan1912
Copy link
Member

@Ganeshswaminathan1912 Ganeshswaminathan1912 commented Jan 31, 2026

Fixes #1872

What changes did you make and why did you make them ?

Summary of changes

  • Removed implicit type coercion by switching time comparisons to numeric timestamps instead of UTC strings, fixing incorrect event timing and cases where events did not open for check-in.
  • Added guards for invalid date values and improved error handling to prevent worker crashes.
  • Replaced per-event creation loops with insertMany for recurring event creation to reduce request volume and memory usage, preventing cron worker from crashing.
  • Added a new API route using bulkWrite for batch PATCH updates (open/close check-ins), while preserving the existing single-event endpoint to avoid breaking dependent services.
  • Emulated the ECS production environment locally with equivalent resources and verified correct behavior through logs (smooth create → open → close flow).
  • Updated unit tests in createRecurringEvents.test.js for batch POST request to test the updated code.

No UI changes. Backend-only cron and API updates. Logs attached
cron-run.log

Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)

Visuals before changes are applied

image

Visuals after changes are applied

image

Copy link
Member

@trillium trillium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean refactor that fixes OOM by batching API calls. N events now = 1 API call instead of N individual calls. Well-documented with JSDoc, tests updated, backward compatible. LGTM.

@trillium trillium merged commit 293c618 into hackforla:development Feb 3, 2026
2 of 5 checks passed
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.

Investigate and Fix Incorrect Event Check-In Times in VRMS

2 participants