Currently we wait up to 10s for this operation to complete.
Replacing the two log lines with three, lets us halve the number of logs printed every 10ms,
but always print exactly one log line each iteration of the loop. Rather than:
```
02-10 19:58:48.880 3140 3140 D CleanupSession: Wait for all Realm instance to be closed (29 - 0)
02-10 19:58:48.880 3140 3140 D CleanupSession: Waiting 10ms
02-10 19:58:48.890 3140 3140 D CleanupSession: Wait for all Realm instance to be closed (29 - 0)
02-10 19:58:48.890 3140 3140 D CleanupSession: Waiting 10ms
02-10 19:58:48.900 3140 3140 D CleanupSession: Wait for all Realm instance to be closed (29 - 0)
02-10 19:58:48.900 3140 3140 D CleanupSession: Waiting 10ms
02-10 19:58:48.910 3140 3140 D CleanupSession: Wait for all Realm instance to be closed (29 - 0)
02-10 19:58:48.910 3140 3140 D CleanupSession: Waiting 10ms
02-10 19:58:48.920 3140 3140 D CleanupSession: Wait for all Realm instance to be closed (0 - 0)
```
We'll print:
```
02-10 19:58:48.880 3140 3140 D CleanupSession: Waiting 10ms for all Realm instance to be closed (29 - 0)
02-10 19:58:48.890 3140 3140 D CleanupSession: Waiting 10ms for all Realm instance to be closed (29 - 0)
02-10 19:58:48.900 3140 3140 D CleanupSession: Waiting 10ms for all Realm instance to be closed (29 - 0)
02-10 19:58:48.910 3140 3140 D CleanupSession: Waiting 10ms for all Realm instance to be closed (29 - 0)
02-10 19:58:48.920 3140 3140 D CleanupSession: Finished waiting for all Realm instance to be closed (0 - 0)
```
The above example took 40ms to finish and saved 4 log lines; you can see how it adds up if you take 10000ms to finish.
- reworking the isEventRead logic to always check if the new event exists locally, there's a race condition between eventFastLane and syncs where we end up mark unseen events as read if our last local message in a room is from ourselves
- this may also fix some events being instantly marked as read when being received
* develop: (146 commits)
exhaustive not needed anymore
Invert if condition and split long line
Use kotlin string builder
Same issue but in the test
Format
Fix a crash: java.util.IllegalFormatPrecisionException https://github.com/matrix-org/element-android-rageshakes/issues/33398
add changelog file for threads feature
add changelog file for threads feature
Formatting
Improve hidden events for threads
Add TODO for the next Weblate sync
ktlint format
PR remarks
Fix a lint false positive? Anyway this was not used. Restricted API ../../../matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/job/SyncWorker.kt:61: ListenableWorker.getTaskExecutor can only be called from within the same library group (referenced groupId=androidx.work from groupId=element-android)
It seems that now lint rule `MissingQuantity` is an error and not a warning by default.
Whitelist group 'org.webjars' on MavenCentral to fix lint execution
Fix conflicts
Formating & remove unused comments
Fix error in unit test
ktlint format
...
# Conflicts:
# vector/src/main/java/im/vector/app/features/navigation/Navigator.kt
Restricted API
../../../matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/session/sync/job/SyncWorker.kt:61: ListenableWorker.getTaskExecutor can only be called from within the same library group (referenced groupId=androidx.work from groupId=element-android)
* develop: (66 commits)
toolbar management (#4887)
adding changelog entry
adding back periodic flag when scheduling automatic background workers
Fix enum class warning
Split long lines Done by https://github.com/matrix-org/matrix-analytics-events/pull/16
Add new class in analytics plan
Fix conditional for Delight issue automation
Add missing import in kdoc
Update kdoc
Enable Delight issue automation
Fix an error in string resource (#4997)
Changelog
Add some unit test for the command parser. Not all commands are covered, could add more tests later.
data class.
use sealed interface
Small cleanup
Command parser is not a static object anymore
Add changelog
Use Throwable.isLimitExceededError extension
Do not automatically retry 429 with a too long delay
...
`regex.containsMatchIn()` for `.*@room.*` can take significantly longer
than checking for `@room` (some real-world events I was getting took
around 15 seconds with this, significantly slowing down the sync
parsing).
Checking `containsMatchIn()` does not lead to different results when
having leading and trailing stars however, it will match in the same
cases as when these are omitted.
For testing purposes, I sent myself some Lorem Ipsum with 5000 words
(not containing any @room).
Without this change, the regex evaluation takes about 16 seconds.
With this change, the regex evaluation now takes significantly less then
a second.