Comments (11)
➤ PM Bot commented:
Jira ticket: RCOCOA-2302
from realm-swift.
@michael-wb can you take a look at this one?
from realm-swift.
➤ michael-wb commented:
This looks like it is related to RCORE-1982 that I am currently working on. The error reported by core is not fatal, but the sync session will not attempt to reconnect. Both of these will be addressed.
The current workaround is to is to ignore the error for now and the reconnect should occur (at least on Cocoa) once the device is connected to the network.
from realm-swift.
I think the problem is that we're hitting an assertion failure in handle_location_update_failed
, so there's no obvious way to ignore the error here.
from realm-swift.
Thanks all! We've received more information from users, and it seems to be occurring when a network connection appears to exist (local wifi), but that connection may be restricted to most outside sources. Unfortunately this is fairly common use case for our users, so it's quite impactful at the moment.
It looks like the assertion was introduced in realm-core 13.26.0 in this commit.
I was wondering if it would be safe for a production app to rollback from Realm Swift v10.47 to v10.45.3, reverting to the previous version of realm-core?
from realm-swift.
➤ michael-wb commented:
Thanks for the update - the error happens any time the location update fails (e.g. no internet) when a realm is opened. One workaround is to capture the error and just ignore it, as described from a different ticket (copied below). A fix is in progress and I am currently adding tests to verify.
{quote}
If they keep using 10.45.3 (https://github.com/realm/realm-swift/releases/tag/v10.45.3)
A workaround on the meantime is to ignore connection errors while we work on a fix for this, there is already a Core ticket for it https://jira.mongodb.org/browse/RCORE-1982.
An example of the code
{quote}
app.syncManager.errorHandler = { syncError, syncSession in
if let syncError = syncError as? SyncError {
if syncError.code == .connectionFailed {
return
}
self.error = syncError
}
}
{quote}
This will hide the error message while offline. The sync session will be resumed when the device goes online without the need of any extra code (Like previous behaviour).
{quote}
from realm-swift.
That doesn't appear to be our experience. No sync error is reported, and the application is killed from the realm sync thread.
from realm-swift.
➤ michael-wb commented:
Sorry for the inconvenience this has caused.
Are you able to tell if the crash is coming from this line? (fwiw - the handle_location_update_failed
function this is part of is being removed as part of the fix):
https://github.com/realm/realm-core/blob/master/src/realm/object-store/sync/sync_session.cpp#L253
REALM_ASSERT(m_state == State::WaitingForAccessToken);
from realm-swift.
It seems likely. The next call in the stack trace is to realm::util::terminate
, which would track with that REALM_ASSERT macro. Is it possible to disable assertions from the Realm Swift SDK (installed via CocoaPods)?
I'm also happy to rollback to v10.45.3 for a while if there wouldn't be any compatibility issues with apps that had already been running v10.47
from realm-swift.
Hi @gyratorycircus,
This has been updated in the Swift SDK v10.49.1 (based on Realm v14.4.1) to no longer throw the fatal error if the location update fails while offline. However, there is still an outstanding issue (realm/realm-core#7527) regarding @AutoOpen
, where it will not exit the .connecting
state if the location needs to be updated and the client is offline. There is a fix for this issue in review and will be merged shortly.
from realm-swift.
@gyratorycircus - Sorry for the delay, the Realm Swift v10.50.0 release includes a fix (in Realm Core PR #7528) that is part of Core v16.5.2 so the @AutoOpen
class so it will fall through and open the local realm if the asynchronous sync/update is not able to successfully update the realm (e.g. currently offline).
Please reopen this ticket or file a new one if you find that it is still not working for you.
from realm-swift.
Related Issues (20)
- Is it possible to fully deallocate the Memory used by Realm HOT 4
- Doesn't Map value type work at all? HOT 4
- Multiple methods named 'initWithValue:' found with mismatched result, parameter type or attributes v10.50.1 HOT 3
- ObjectId does not conform to SortableType - sorted(by:ascending:) not working as expected HOT 3
- Namespace DYLD, Code 1 Library missing HOT 2
- RealmSwift Crashing on Xcode 16 beta 2 when used in XCFramework as Dependency HOT 2
- Support "Cascading/Inheritable" Writes HOT 16
- Realm crash when accessing PersistableEnum HOT 13
- 极个别用户数据会莫名删除清空 HOT 2
- Query Syntax: Incorrect NSPredicate When Using `.values` on a Map Property HOT 6
- Migration strange behavior when schema version resets to zero HOT 12
- XCFramework compitability issue with Xcode HOT 2
- Ensure Migration.enumerateObjects(ofType:_:) consistently uses property mappings HOT 5
- Migrate Sync tests to use Basaas HOT 1
- Schema version is increased before Realm is initialized causing migration block to not run HOT 6
- N5realm18MultipleSyncAgentsE crash on start HOT 1
- realm::util::File::barrier() HOT 9
- Unit Test: Undefined symbol: _$s10RealmSwift0A0V13ConfigurationV07defaultC0AEvgZ HOT 3
- Allow KVC Collection Operators in Sort Descriptors HOT 7
- 'Realm accessed from incorrect thread.' in iOS 18 while in iOS 17 no issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from realm-swift.