Closed LeonardDaVinci closed 1 year ago
Hi @LeonardDaVinci
I tried to reproduce this behavior, but it seems to work also in 10.13. Your code looks correct, but it sounds like something you can reproduce?
Perhaps it is a problem with your input parameter to the function. Have you verified that RealmResults<OderHistoryOl> results
actually returns any results?
Thank you. Yes, I checked again with debug and have seen that input parameters (time) is always present, having right values with 10.12 and also with 10.13 Really strange.. 10.12 delete but 10.13 not..
What I suppose: my app is a waiter order app for restaurant. In this case it does
And here is the problem: could it be that the asynchronous saving at step 2 is very very slow and it is not immediately saved on Realm but they get saved AFTER my step 5?
Is there a way to immediately force a flush when saving or deleting objects in Realm?
Hi @LeonardDaVinci. It seems the asynchronous call may be running too slowly. You could try to run those steps synchronously and see if the problem is solved. You can try with realm.executeTransaction
instead, that would run it synchronously and you might avoid a possible race condition.
Hi @edualonso. I made test, writing also using .allowQueriesOnUiThread(true) but still no luck. I wrote .executeTransaction but app crash!... I have to think some other solution..
Hi @LeonardDaVinci we need more context about the issue to tell what's going on. Would you be able to create and share a test project that reproduces this issue?
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.
How frequently does the bug occur?
All the time
Description
Hello,
I wanted to upgrade realm in my Android (Dolphin) project from dependencies = classpath 'io.realm:realm-gradle-plugin:10.12.0' to dependencies = classpath 'io.realm:realm-gradle-plugin:10.13.0'
I have noticed that using exactly the same code, deleteAllFromRealm() does NOT work with gradle-plugin:10.13.0 - records are not deleted at all!
Making the same with with gradle-plugin:10.12.0 all records get deleted as usual.
This is the piece of code, that has two differents results using it with Realm 10.12.0 or Realm 10.13.0
Am I making some mistake in code?
Thank you for help.
Stacktrace & log output
No response
Can you reproduce the bug?
Yes, always
Reproduction Steps
Leaving exactly the same java code, but only changing build.gradle dependencies = classpath 'io.realm:realm-gradle-plugin:10.12.0'
to dependencies = classpath 'io.realm:realm-gradle-plugin:10.13.0' will allways cause the issue
Version
classpath 'io.realm:realm-gradle-plugin:10.13.0'
What SDK flavour are you using?
Local Database only
Are you using encryption?
Yes, using encryption
Platform OS and version(s)
Android 7, Android 11
Build environment
Win10 64Bit Android Studio Dolphin | 2021.3.1
Android Gradle Plugin Version 7.3.0
Gradle version 7.6