Skip to content

fix(build): App.xaml.cs called the removed SessionService.Logout() - #186

Merged
Adron merged 1 commit into
mainfrom
fix-app-logout-rename
Sep 24, 2026
Merged

Adron merged 1 commit into
mainfrom
fix-app-logout-rename

Conversation

@Adron

@Adron Adron commented Sep 24, 2026

Copy link
Copy Markdown
Member

/tmp/batch.sh $(gh pr list --repo $R --state open --limit 5 --json number,headRefName --jq '.[]|select(.headRefName=="fix-app-logout-rename")|.number')

```
error CS1061: 'SessionService' does not contain a definition for 'Logout'
  App.xaml.cs(62,37)
  App.xaml.cs(136,37)
```

## Cause

#148 replaced the synchronous `Logout()` with `async Task<LogoutOutcome> LogoutAsync()` and split out `ClearLocalSession()`. #170 was branched before that landed and added two `App.xaml.cs` call sites using the old name — for the account-status work, discarding a session belonging to a **closed (banned)** account.

Git merged both cleanly: #148 changed `SessionService.cs`, #170 changed `App.xaml.cs`. Neither touched the other's file, so there was no textual conflict. **The third cross-PR break of this shape in this pass** — after the duplicate header helpers (#183) and the contract suite's missing includes (#185). `MERGEABLE` keeps not meaning "compiles after merging".

## Fix

Both sites now call `ClearLocalSession()`, which is the right method rather than merely the one that compiles:

- The account is **closed**, so there's no useful server call to make — `LogoutAsync()` would attempt a logout and a session revoke for a token that's already dead.
- Both call sites are **synchronous** (`OnStartup`'s decision branch and the post-sign-in guard), and `LogoutAsync` is async.
- `ClearLocalSession()` is documented for exactly this: drop local state when the server side is already gone.

`LogoutAsync()` remains what a user-initiated sign-out calls. A comment at each site records the distinction so neither gets "upgraded" to the async version.

## Verification

- `dotnet build -c Debug` — **green**
- `dotnet build -c Release` — **green**

🤖 Generated with [Claude Code](https://claude.com/claude-code)
PRBODY
fix(build): App.xaml.cs called the removed SessionService.Logout()

main did not compile after #170 merged — two CS1061s in App.xaml.cs.

#148 replaced the synchronous Logout() with async Task<LogoutOutcome>
LogoutAsync() and split out ClearLocalSession(). #170 was branched before that
landed and added two App.xaml.cs call sites using the old name, for the
account-status work that discards a session belonging to a closed account.

Git merged both cleanly because #148 changed SessionService.cs and #170 changed
App.xaml.cs — neither touched the other's file, so no textual conflict. Third
cross-PR break of this shape in this pass, after the duplicate header helpers
(#183) and the contract suite's missing includes (#185).

Both sites now call ClearLocalSession(), which is the correct method and not
just the one that compiles: the account is closed so there is no useful server
call to make, both call sites are synchronous, and ClearLocalSession is
documented for exactly this case. LogoutAsync stays what a user-initiated
sign-out calls; a comment at each site records the distinction.

Verified: Debug and Release both build clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Adron
Adron merged commit 94811b6 into main Sep 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant