Skip to content
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

Don't delete file in case of ResetFile schema mode #7331

Closed
wants to merge 1 commit into from

Conversation

jedelbo
Copy link
Contributor

@jedelbo jedelbo commented Feb 9, 2024

What, How & Why?

Fixes #7140

☑️ ToDos

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

@cla-bot cla-bot bot added the cla: yes label Feb 9, 2024
@jedelbo jedelbo requested a review from tgoyne February 9, 2024 12:13
Copy link

Pull Request Test Coverage Report for Build jorgen.edelbo_74

  • 30 of 30 (100.0%) changed or added relevant lines in 1 file are covered.
  • 103 unchanged lines in 12 files lost coverage.
  • Overall coverage decreased (-0.02%) to 91.843%

Files with Coverage Reduction New Missed Lines %
src/realm/array_string.cpp 2 88.0%
src/realm/sync/network/http.hpp 2 82.41%
src/realm/sync/network/websocket.cpp 2 74.44%
src/realm/sync/client.cpp 3 91.1%
src/realm/util/file.cpp 3 81.06%
test/test_thread.cpp 3 66.67%
src/realm/sync/noinst/client_impl_base.cpp 5 85.46%
src/realm/util/serializer.cpp 5 90.03%
src/realm/sync/transform.cpp 6 62.67%
src/realm/bplustree.cpp 7 75.72%
Totals Coverage Status
Change from base Build 2021: -0.02%
Covered Lines: 235289
Relevant Lines: 256185

💛 - Coveralls

@tgoyne
Copy link
Member

tgoyne commented Feb 9, 2024

UnsupportedFileFormatVersion is thrown when we can't upgrade the file, and I think deleting the file is clearly correct for the ResetFile schema mode then.

Deleting rather than upgrading the file was implemented due to realm/realm-swift#4470. The idea is that using ResetFile clearly only makes sense if your data is disposable and performing a slow upgrade doesn't make sense if you can just regenerate it anyway.

@jedelbo
Copy link
Contributor Author

jedelbo commented Feb 12, 2024

OK - dropping this approach

@jedelbo jedelbo closed this Feb 12, 2024
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Method to check if file format upgrade is possible
2 participants