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

@AutoOpen offline doesn't work when upgrading to latest version. #8469

Open
dvhull opened this issue Jan 23, 2024 · 4 comments
Open

@AutoOpen offline doesn't work when upgrading to latest version. #8469

dvhull opened this issue Jan 23, 2024 · 4 comments

Comments

@dvhull
Copy link

dvhull commented Jan 23, 2024

How frequently does the bug occur?

Always

Description

I did not have issues with sync connection issues until I upgraded my package version. I thought it might be to something with my code so I went back to the example project here when I was learning realm:

https://github.com/mongodb-university/realm-template-apps/tree/20d5e3b39c30e777a2d2204cd122e72e7c0bf0d3/sync-todo/v2/client/swiftui/App

The results were the same when upgrading to the latest realm package version offline mode is no longer supported. However using a previous version like 10.41.1 I was able to get it working.

My application subscription retention relays a lot on offline support so any help would be great.

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

clone the repository provided:
https://github.com/mongodb-university/realm-template-apps/tree/20d5e3b39c30e777a2d2204cd122e72e7c0bf0d3/sync-todo/v2/client/swiftui/App

Upgrade Packages to latest version in XCode.

Turn on airplane mode wait a bit and see a connection error.

Enter the app and see that there is sync connection errors.

Version

13.26.0

What Atlas Services are you using?

Atlas Device Sync

Are you using encryption?

No

Platform OS and version(s)

iOS 17

Build environment

Xcode version: Version 15.0.1
Realm: 13.26.0
Realm Database: 13.26.0

@dvhull
Copy link
Author

dvhull commented Jan 29, 2024

I am using flexible sync. Any help would greatly be appreciated my app's subscription retention. Right now this is my sole income.

Sorry, to bother you @dianaafanador3 I know you have worked on this issue previously. Any suggestions or help of how I can get this issue resolved would be greatly appreciated.

Thanks.

@Jaycyn
Copy link

Jaycyn commented Jan 30, 2024

Just to tie back to the initial response

mongodb-university/realm-template-apps#183

@nirinchev
Copy link
Member

We've been able to reproduce the issue and it appears to be a regression in the Core database. The workaround is to ignore the connection error as it should be transient and Realm will eventually reconnect:

app.syncManager.errorHandler = { syncError, syncSession in
   if let syncError = syncError as? SyncError {
      if syncError.code == .connectionFailed {
          return
      }
      self.error = syncError
   }
} 

@dvhull
Copy link
Author

dvhull commented Feb 17, 2024

We've been able to reproduce the issue and it appears to be a regression in the Core database. The workaround is to ignore the connection error as it should be transient and Realm will eventually reconnect:

app.syncManager.errorHandler = { syncError, syncSession in
   if let syncError = syncError as? SyncError {
      if syncError.code == .connectionFailed {
          return
      }
      self.error = syncError
   }
} 

Hey,

I really appreciate you giving me this workaround it seems to work. Thank you.

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

4 participants