Skip to content

Make session Load/Save provider-aware#7

Open
wydrox wants to merge 1 commit into
mainfrom
refactor/session-provider-aware
Open

Make session Load/Save provider-aware#7
wydrox wants to merge 1 commit into
mainfrom
refactor/session-provider-aware

Conversation

@wydrox

@wydrox wydrox commented Apr 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Remove the unused sessionFile global so Load()/Save() delegate to LoadProvider(CurrentProvider()) / SaveProvider(CurrentProvider(), s) without an accidental Frisco-only path.
  • SessionFilePath now derives the frisco path directly from sessionDir, keeping behavior identical for the default provider while ensuring Delio writes never accidentally land in the Frisco file.
  • Add coverage for provider-specific writes, cross-provider reads, and Delio legacy-dir fallback. Adds a small setTempProvider test helper for isolated currentProvider state.

Test plan

  • go vet ./...
  • go test ./... -race
  • go build -o bin/martmart ./cmd/martmart + ./bin/martmart --help + ./bin/martmart config show
  • ./bin/martmart --provider delio session show and --provider frisco session show each read their own file; session from-curl writes the correct {frisco,delio}-session.json under ~/.martmart-cli/.

Remove the global sessionFile variable so that Load() and Save() correctly
follow CurrentProvider() for both Frisco and Delio. SessionFilePath now
derives paths deterministically from sessionDir, and tests exercise both
provider-specific file writes and legacy fallback for Delio.
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