8000 Throw exception if a changeset timestamp is set before 2015 by danieltabacaru · Pull Request #7180 · realm/realm-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Throw exception if a changeset timestamp is set before 2015 #7180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 5, 2023

Conversation

danieltabacaru
Copy link
Collaborator
@danieltabacaru danieltabacaru commented Dec 4, 2023

What, How & Why?

The sync client currently sets a changeset's timestamp as the number of milliseconds since 2015-01-01T00:00:00Z. This timestamp may be incorrect if the local clock lags behind 2015-01-01T00:00:00Z. We are addressing this problem by throwing an exception instead.

☑️ ToDos

  • 📝 Changelog update
  • [ ] 🚦 Tests (or not relevant)
  • [ ] C-API, if public C++ API changed
  • [ ] bindgen/spec.yml, if public C++ API changed

Copy link
coveralls-official bot commented Dec 4, 2023

Pull Request Test Coverage Report for Build daniel.tabacaru_670

  • 2 of 5 (40.0%) changed or added relevant lines in 2 files are covered.
  • 441 unchanged lines in 17 files lost coverage.
  • Overall coverage decreased (-0.02%) to 91.661%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/realm/sync/history.hpp 1 4 25.0%
Files with Coverage Reduction New Missed Lines %
src/realm/array_key.cpp 1 97.53%
src/realm/array_blobs_big.cpp 2 98.72%
src/realm/query_expression.hpp 2 93.59%
src/realm/table_view.cpp 2 94.18%
src/realm/uuid.cpp 2 97.06%
src/realm/sync/client.cpp 3 90.93%
src/realm/util/assert.hpp 4 87.1%
test/object-store/sync/session/session.cpp 4 98.5%
test/object-store/util/event_loop.cpp 6 76.86%
src/realm/util/file.cpp 7 81.18%
Totals Coverage Status
Change from base Build 1878: -0.02%
Covered Lines: 231813
Relevant Lines: 252902

💛 - Coveralls

@danieltabacaru danieltabacaru marked this pull request as ready for review December 5, 2023 12:43
@@ -61,6 +61,7 @@ ErrorCategory ErrorCodes::error_categories(Error code)
case SyncServerPermissionsChanged:
case SyncUserMismatch:
case SyncWriteNotAllowed:
case SyncLocalClockBehind:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd maybe call this SyncLocalClockBeforeEpoch

@danieltabacaru danieltabacaru merged commit a62f7e9 into master Dec 5, 2023
@danieltabacaru danieltabacaru deleted the dt/sync_local_clock_lagging branch December 5, 2023 19:41
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0