fix(git): wire JvmGitRepository on desktop and keep OAuth code visible during polling#166
Merged
Conversation
…e during polling
Two bugs prevented git sync from being usable on desktop:
1. Main.kt omitted `gitRepository`, keeping `gitSyncService` and
`gitConfigRepository` null, so `canShowGitSetup` was always false
and the Git Setup wizard never appeared.
2. `OAuthDialogState.Polling` was a data object with no fields;
transitioning to it hid the user code ~5 seconds into the OAuth
flow, before most users could copy or enter it.
Fixes:
- Add `remember { JvmGitRepository() }` to `StelekitApp(...)` call in
`Main.kt` so the Git Setup wizard opens on the first click.
- Promote `OAuthDialogState.Polling` to a data class carrying
`userCode`, `verificationUri`, and `expiresAt`.
- Update `startOAuthFlow` to pass those values into `Polling`.
- Update the `Polling` UI branch to show the code, countdown,
copy/open buttons, and a demoted "Waiting…" spinner — identical
to `ShowCode` but with a polling indicator.
- Add a state-model test asserting `Polling` carries its fields.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
JVM Load Benchmark (Desktop)Synthetic in-memory benchmark measuring load performance for the desktop (JVM) app.
Flamegraphs (this PR)**Allocation** — object allocation pressure (JDBC/SQLite churn)Alloc flamegraph not available CPU — method-level hotspots by on-CPU time CPU flamegraph not available Top SQL queries by total time (this PR)| table:operation | calls | p50 | p99 | max | total | |-----------------|-------|-----|-----|-----|-------| | `blocks_fts:insert` | 2 | 1ms | 1ms | 0ms | 0ms | | `pages:select` | 2 | 1ms | 1ms | 0ms | 0ms |Top allocation hotspots (this PR)`37.4%` byte[]_[k] `7.3%` java.lang.String_[k] `7.2%` java.util.LinkedHashMap$Entry_[k] `5%` int[]_[k] `3.6%` java.lang.Object[]_[k]Top CPU hotspots (this PR)`95%` /usr/lib/x86_64-linux-gnu/libc.so.6 `1.8%` /tmp/sqlite-3.51.3.0-ec245585-ee77-418c-a0ba-73629438397a-libsqlitejdbc.so `0.5%` pthread_cond_signal `0.2%` __libc_pwrite `0.2%` SR_handler |
…howCode/Polling UI Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Android Load BenchmarkInstrumented benchmark on an API 30 x86_64 emulator — 500-page synthetic graph. Comparing Graph Load
Interactive Write Latency (during Phase 3)
SAF I/O Overhead (ContentProvider vs direct File read)Measures Binder IPC cost added by ContentResolver per readFile() call.
|
…ry poll paths Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eEmitters rule Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Main.ktomittedgitRepository, sogitSyncService/gitConfigRepositoryremained null andcanShowGitSetupwas always false — the wizard silently never rendered. Fixed by addingremember { JvmGitRepository() }to theStelekitApp(...)call.OAuthDialogState.Pollingwas adata objectwith no fields. Transitioning to it ~5 seconds in hid the code before users could copy or enter it. Fixed by promotingPollingto adata classcarryinguserCode/verificationUri/expiresAtand updating the UI branch to keep the code + copy/open buttons visible alongside a demoted "Waiting…" spinner.Test plan
GitHubDeviceFlowClientTest.OAuthDialogState_Polling_carries_code_and_expiry_fields— new state model test passes./gradlew jvmTest— all existing tests still pass🤖 Generated with Claude Code