Repository navigation
feat(mobile): open the sessions behind a dashboard row - #208
Open
nikbackdev wants to merge 1 commit into
Open
nikbackdev wants to merge 1 commit into
nikbackdev wants to merge 1 commit into
Conversation
Signed-off-by: Nikita.Bazhenov <226111163+nikbackdev@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
A row of a table on the phone's Dashboard page opens the sessions behind it, as the desktop Dashboard does: each session with its start and end, its own minutes, its tool, project and ticket. The minutes of the sessions of a row add up to the row. Sessions overlap in time are said to share their minutes, as on the computer. A row of a day or week for which the computer sent no sessions says so, with no empty list.
This is stacked on the Android Dashboard pull request (#206); the base of this pull request is its branch.
sync-dashboard-sessions, gives the sessions behind each group of the numbers the phone already copies. It reuses the computer's owndashboard-sessionscounting, so the rows are the ones the numbers counted. A row has onlystart,end(UTC),minutes,tool,project,ticketand the first 8 characters of the session id: no text of a message.DashboardHolder.sessionsOf(widget, row)gives a row its sessions with times in the computer's time zone, and whether they were sent and whether some share minutes.Why a command of its own, and what it costs
The numbers items are capped at 14 KB and a page of a sync at 12 KB, and a heavy day has hundreds of sessions, so the sessions do not fit in the numbers items. They travel in
sessionsitems (one group, several items for a long group) under a command of their own, paged by the same budget. Positions of this command are an entry and an item of it.Compatibility: the message of
sync-dashboardis unchanged and the protocol number stays 1. An older phone never asks for the new command and keeps working without the sessions. A newer phone that meets an older computer gets an error for the command, keeps the numbers and shows "has not sent the sessions".Size: sessions are sent only for the entries that start within 62 days of the newest one, not for all history. On a fixture of 300 sessions of one project on one day, the day and its week hold 600 rows in 12 items and 94,392 bytes together, about 160 bytes a session for each entry that holds it (once for its day and once for its week). A heavy week of a few hundred sessions therefore adds about 50 KB for the week entry plus the same sessions again for their days. Entries are counted once and kept until their activity changes, so a check that finds nothing new sends and counts nothing.
Tests
the_sessions_of_each_group_come_in_pages_with_no_text_and_add_up_to_the_group(agent): on 300 sessions, every page is under the channel's line limit, every row has exactly the seven fields and no message text, and the rows of each group add up to the group's minutes in its numbers.the_sessions_are_not_sent_for_days_long_before_the_newest_and_a_changed_part_is_said(agent): no sessions for a day or week older than the limit; the same token as the numbers; a stale token is answeredchanged.SyncEngineTest: sessions arrive with the numbers of their day (a group in two items is put together) and a day with none keeps none; a computer that does not know the command still gives the numbers.CopySyncTest: the sessions are kept with the numbers of their day, replaced by a sync that brings none, and gone after "Delete everything".DashboardHolderTest: a row's sessions add up to the row with times in the computer's zone; overlapping sessions are flagged; a row of a day with no sessions is "not sent".DashboardPageTest(Android) andDashboardTests(iPhone UI): a row opens its sessions, they add up, and a row of a day with none says the computer has not sent them (Android; the iPhone test checks the list against the row).What ran
cargo fmt --check,cargo clippy --locked -p construct-agent --all-targets -- -D warningsclean;cargo test --locked -p construct-agent --test phone: 61 passed, 0 failed../gradlew check --continueinmobile: ktlint, detekt, lint and all Android host tests pass (sync 39, database 64, dashboard 19, no failures). The only failing tasks are theiosSimulatorArm64Testones: this Mac has Xcode and the iOS SDK but no Simulator runtime, and Gradle says so.iosApp/check.sh: structure rules andswiftlint --strictclean (0 violations in 75 files).xcodebuild build-for-testingfor the iOS Simulator: succeeded, so the Swift pages and the UI test compile against the Kotlin framework.What did not run
DashboardTestsand the Android emulator run ofDashboardPageTest: no Simulator runtime and no Android system image on the machine this was written on. They compile but have not run.