Skip to content

Commit

Permalink
Prevent opening files with file format 23 in read-only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jedelbo committed Feb 27, 2024
1 parent 5ea7da5 commit 4f82d8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
### Fixed
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* List KVO information was being populated for non-list collections ([PR #7378](https://github.com/realm/realm-core/pull/7378), since v14.0.0)
* Opening file with file format 23 in read-only mode will crash ([#7388](https://github.com/realm/realm-core/issues/7388), since v14.0.0)

### Breaking changes
* None.

### Compatibility
* Fileformat: Generates files with format v24. Reads and automatically upgrade from fileformat v10. If you want to upgrade from an earlier file format version you will have to use RealmCore v13.x.y or earlier.
You cannot open files with an file format older than v24 in read-only mode.

-----------

Expand Down
3 changes: 1 addition & 2 deletions src/realm/group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ int Group::get_target_file_format_version_for_session(int current_file_format_ve
// individual file format versions.

if (requested_history_type == Replication::hist_None) {
if (current_file_format_version == 23) {
if (current_file_format_version == 24) {
// We are able to open these file formats in RO mode
return current_file_format_version;
}
Expand Down Expand Up @@ -419,7 +419,6 @@ int Group::read_only_version_check(SlabAlloc& alloc, ref_type top_ref, const std
case 0:
file_format_ok = (top_ref == 0);
break;
case 23:
case g_current_file_format_version:
file_format_ok = true;
break;
Expand Down

0 comments on commit 4f82d8b

Please sign in to comment.