Skip to content

Conversation

@ascibisz
Copy link
Contributor

@ascibisz ascibisz commented Jan 8, 2026

Problem

I noticed that edited recipes collection isn't being cleared out as we would expect by our daily jobs.

After digging in, it's because the timestamps aren't being formatted in the right way on upload to the edited recipes collection.

Solution

Use firebase's Timestamp.now() instead of Date.now() to get the timestamp in the proper format on upload

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 34.68% 676 / 1949
🔵 Statements 34.68% 676 / 1949
🔵 Functions 40.38% 42 / 104
🔵 Branches 73.46% 144 / 196
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/App.tsx 0% 0% 0% 0% 1-7, 16-19, 21, 23-24, 26-27, 29-35, 37, 39-41, 43-49, 51-64, 66-109, 111-119, 121-156, 158-162, 164-168, 170-189, 191, 193
src/utils/firebase.ts 59.33% 73.91% 62.5% 59.33% 40-43, 82-92, 102-110, 114-127, 130-135, 146-147, 232-237, 240-250, 252-261, 263, 265-269, 271-276
Generated in workflow #220

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

PR Preview Action v1.8.0
Preview removed because the pull request was closed.
2026-01-16 23:53 UTC

@ascibisz ascibisz requested a review from Copilot January 15, 2026 17:47
@ascibisz ascibisz marked this pull request as ready for review January 15, 2026 17:47
@ascibisz ascibisz requested a review from rugeli January 15, 2026 17:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a timestamp formatting issue that prevented edited recipes from being properly cleared by daily maintenance jobs. The fix centralizes timestamp creation using Firebase's Timestamp.now() method instead of JavaScript's Date.now().

Changes:

  • Moved timestamp assignment from the client code to the addRecipe utility function
  • Replaced Date.now() with Firebase's Timestamp.now() for proper Firestore compatibility

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/utils/firebase.ts Added timestamp field using Timestamp.now() in the addRecipe function
src/App.tsx Removed redundant timestamp assignment that used incorrect Date.now() method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@rugeli rugeli left a comment

Choose a reason for hiding this comment

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

LGTM!

@ascibisz ascibisz merged commit 937c567 into main Jan 16, 2026
2 checks passed
@ascibisz ascibisz deleted the fix/set-edited-recipe-timestamp branch January 16, 2026 23:53
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.

3 participants