Skip to content

Improve shared water sync across platforms#264

Merged
TienNguyen3711 merged 1 commit into
masterfrom
pr/api-cross-platform-sync
May 12, 2026
Merged

Improve shared water sync across platforms#264
TienNguyen3711 merged 1 commit into
masterfrom
pr/api-cross-platform-sync

Conversation

@TienNguyen3711
Copy link
Copy Markdown
Collaborator

Summary

  • improve shared hydration sync between web and mobile by making water intake writes idempotent per user and date
  • normalize daily water intake updates so repeated writes update the same record instead of creating diverging entries
  • make cross-platform hydration reads more reliable by supporting a single source of truth for the current day

What files changed

  • routes/waterIntake.js

Testing

  • reviewed GET /api/water-intake and POST /api/water-intake flow against authenticated user scoping
  • verified route syntax with:
    • node -c routes/waterIntake.js
  • manually confirmed the route now:
    • resolves the authenticated user for normal requests
    • normalizes the request date
    • updates the existing daily row when one already exists
    • inserts only when no row exists yet
  • not run end-to-end across clients in this final pass

@TienNguyen3711 TienNguyen3711 requested a review from Vedant1515 May 11, 2026 10:56
@TienNguyen3711 TienNguyen3711 merged commit 45ced0d into master May 12, 2026
9 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.

1 participant