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

RLMRealmConfiguration.seedFilePath is not copied in copyWithZone: #8427

Open
adysart opened this issue Nov 30, 2023 · 0 comments
Open

RLMRealmConfiguration.seedFilePath is not copied in copyWithZone: #8427

adysart opened this issue Nov 30, 2023 · 0 comments

Comments

@adysart
Copy link

adysart commented Nov 30, 2023

How frequently does the bug occur?

Always

Description

The seedFilePath property on RLMRealmConfiguration is not included when this type is copied in copyWithZone:. Since the configuration is copied when it is set as the default configuration, this means that it is not possible to set a seedFilePath on the default configuration.

The seedFilePath state is maintained in a property local to RLMRealmConfiguration:

_seedFilePath = seedFilePath;

The copyWithZone: method does not include that state when copied:

- (instancetype)copyWithZone:(NSZone *)zone {
RLMRealmConfiguration *configuration = [[[self class] allocWithZone:zone] init];
configuration->_config = _config;
configuration->_cache = _cache;
configuration->_dynamic = _dynamic;
configuration->_migrationBlock = _migrationBlock;
configuration->_shouldCompactOnLaunch = _shouldCompactOnLaunch;
configuration->_customSchema = _customSchema;
configuration->_eventConfiguration = _eventConfiguration;
configuration->_migrationObjectClass = _migrationObjectClass;
configuration->_initialSubscriptions = _initialSubscriptions;
configuration->_rerunOnOpen = _rerunOnOpen;
return configuration;
}

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

  1. Get the current defaultConfiguration
  2. Set the seedFilePath property on this configuration to a non-nil value
  3. Set this configuration as the new defaultConfiguration
  4. Observe seedFilePath on the default configuration is nil

Version

10.44.0

What Atlas Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

iOS 17

Build environment

Xcode version: ...
Dependency manager and version: ...

@adysart adysart added the T-Bug label Nov 30, 2023
@adysart adysart changed the title RLMRealmConfiguration.seedFilePath is copied in copyWithZone: RLMRealmConfiguration.seedFilePath is not copied in copyWithZone: Nov 30, 2023
pikciu pushed a commit to pikciu/realm-swift that referenced this issue Apr 11, 2024
pikciu pushed a commit to pikciu/realm-swift that referenced this issue Apr 11, 2024
pikciu added a commit to pikciu/realm-swift that referenced this issue Apr 11, 2024
tgoyne pushed a commit that referenced this issue Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant