status-im / status-go

The Status module that consumes go-ethereum
https://status.im
Mozilla Public License 2.0
719 stars 243 forks source link

fix(manager): make sure createCommunityPermission schedules the reeval #5404

Closed jrainville closed 5 days ago

jrainville commented 1 week ago

Fixes https://github.com/status-im/status-desktop/issues/15175

The problem was that we used StartMembersReevaluaitonLoop in createCommunityPermission, in case the loop was never started. Indeed it worked if it was the first ever permission, because the loop would then start and members would be re-evaluated.

However, if the loop was already started, in the case where there were previous permissions, the call would just early exit, because it was already started.

The solution here is to use ScheduleMembersReevaluaiton like other permission functions use. To make sure a first permission still works, we call startLoop in schedule if the task doesn't exist.

You can see the fixed behavior here (sorry for the long wait, I changed the reeval delay to be 1 minute instead of 5, but it's still something)

reeval-on-create.webm

status-im-auto commented 1 week ago

Jenkins Builds

Click to see older builds (8) | :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result | |-|-|-|-|-|-|-| | :heavy_multiplication_x: | 266b5955 | [#1](https://ci.status.im/job/status-go/job/prs/job/tests/job/PR-5404/1/) | 2024-06-21 18:36:03 | ~1 min | `tests` | [:page_facing_up:`log`](https://ci.status.im/job/status-go/job/prs/job/tests/job/PR-5404/1//consoleText) | | | | | | | | | | :heavy_check_mark: | 266b59551c2d23e285a15785a41f17ab438fa391 | [#1](https://ci.status.im/job/status-go/job/prs/job/ios/job/PR-5404/1/) | 2024-06-21 18:38:39 | ~3 min | `ios` | [:package:`zip`](https://status-im-prs.ams3.cdn.digitaloceanspaces.com/status-go-ios-240621-183443-266b59551c2d23e285a15785a41f17ab438fa391-pr5404.zip) | | :heavy_check_mark: | 266b59551c2d23e285a15785a41f17ab438fa391 | [#1](https://ci.status.im/job/status-go/job/prs/job/linux/job/PR-5404/1/) | 2024-06-21 18:38:48 | ~3 min | `linux` | [:package:`zip`](https://status-im-prs.ams3.cdn.digitaloceanspaces.com/status-go-desktop-240621-183448-266b59551c2d23e285a15785a41f17ab438fa391-pr5404.zip) | | :heavy_check_mark: | 266b59551c2d23e285a15785a41f17ab438fa391 | [#1](https://ci.status.im/job/status-go/job/prs/job/android/job/PR-5404/1/) | 2024-06-21 18:40:08 | ~5 min | `android` | [:package:`aar`](https://status-im-prs.ams3.cdn.digitaloceanspaces.com/status-go-android-240621-183443-266b59551c2d23e285a15785a41f17ab438fa391-pr5404.aar) | | | | | | | | | | :heavy_check_mark: | fb39a8e654fb15205ee52025328e0a5af3e32e39 | [#2](https://ci.status.im/job/status-go/job/prs/job/android/job/PR-5404/2/) | 2024-06-21 21:19:20 | ~1 min | `android` | [:package:`aar`](https://status-im-prs.ams3.cdn.digitaloceanspaces.com/status-go-android-240621-211746-fb39a8e654fb15205ee52025328e0a5af3e32e39-pr5404.aar) | | :heavy_check_mark: | fb39a8e654fb15205ee52025328e0a5af3e32e39 | [#2](https://ci.status.im/job/status-go/job/prs/job/ios/job/PR-5404/2/) | 2024-06-21 21:20:20 | ~2 min | `ios` | [:package:`zip`](https://status-im-prs.ams3.cdn.digitaloceanspaces.com/status-go-ios-240621-211746-fb39a8e654fb15205ee52025328e0a5af3e32e39-pr5404.zip) | | :heavy_check_mark: | fb39a8e654fb15205ee52025328e0a5af3e32e39 | [#2](https://ci.status.im/job/status-go/job/prs/job/linux/job/PR-5404/2/) | 2024-06-21 21:21:43 | ~3 min | `linux` | [:package:`zip`](https://status-im-prs.ams3.cdn.digitaloceanspaces.com/status-go-desktop-240621-211751-fb39a8e654fb15205ee52025328e0a5af3e32e39-pr5404.zip) | | | | | | | | | | :heavy_multiplication_x: | fb39a8e6 | [#2](https://ci.status.im/job/status-go/job/prs/job/tests/job/PR-5404/2/) | 2024-06-21 21:20:30 | ~2 min | `tests` | [:page_facing_up:`log`](https://ci.status.im/job/status-go/job/prs/job/tests/job/PR-5404/2//consoleText) |
:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:heavy_check_mark: cb61418dd9d517ba118d80fac19f7d7dc0c4715d #3 2024-06-25 17:30:50 ~2 min android :package:aar
:heavy_check_mark: cb61418dd9d517ba118d80fac19f7d7dc0c4715d #3 2024-06-25 17:31:01 ~2 min linux :package:zip
:heavy_check_mark: cb61418dd9d517ba118d80fac19f7d7dc0c4715d #3 2024-06-25 17:31:58 ~3 min ios :package:zip
:heavy_check_mark: cb61418d #3 2024-06-25 18:11:25 ~42 min tests :page_facing_up:log