Code Monkey home page Code Monkey logo

Comments (5)

sync-by-unito avatar sync-by-unito commented on July 20, 2024

➤ PM Bot commented:

Jira ticket: RCOCOA-2337

from realm-swift.

chenyanping01 avatar chenyanping01 commented on July 20, 2024

The code:

let messagesList = getRealm(for: Message.self).objects(Message.self).filter(predicate) //get messages from realm db
if notificationToken == nil {
      notificationToken = messagesList.observe(keyPaths: [\Message.isRead]) { [weak self] (changes: RealmCollectionChange) in
         switch changes {
         case .initial:
              print("[notificationToken] initial")
          case .update(let results, _, _, _):
              print("[notificationToken] update")
              let count = results.count // **_Crash here!!!_**
              updateUI(count)
                    
          case .error(let error):
              print("[notificationToken] error")
                
          }
      }
}
deinit {
        notificationToken?.invalidate()
        notificationToken = nil
 }

from realm-swift.

nirinchev avatar nirinchev commented on July 20, 2024

Do you think you can extract a minimal repro that we can use to investigate? There's nothing obviously wrong with your code or the calls mentioned in the stacktrace, so it's not clear what could be causing the crash. If we had a repro we could debug, that would go a long way to fixing it.

from realm-swift.

Jaycyn avatar Jaycyn commented on July 20, 2024

Can you include the code for this getRealm(for: Message.self)?

Is this a local or sync'd realm

Are you using any kind of threading, await/async or @Actor?

from realm-swift.

github-actions avatar github-actions commented on July 20, 2024

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

from realm-swift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.