Skip to content

Support SMB domain accounts and partial syncs - #363

Merged
ultraelectronica merged 1 commit into
moss-apps:versionFfrom
adithya-s-119:fix/smb-account-interrupted-sync
Nov 7, 2026
Merged

ultraelectronica merged 1 commit into
moss-apps:versionFfrom
adithya-s-119:fix/smb-account-interrupted-sync

Conversation

@adithya-s-119

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #361. Two remaining SMB problems:

  • Domain accounts could never authenticate. smb2 passes the account name and domain to NTLM separately, but Flick only has one username field and was sending DOMAIN\user (or user@domain) as the account with an empty domain. Those forms are now split into the pieces a Windows client sends. Plain local usernames are unchanged.
  • An interrupted library walk discarded everything it had already listed. The Dart side collected entries while the Rust stream walked the share, then only imported them after the stream finished. A Wi-Fi drop or session expiry halfway through meant zero new rows on a first sync, even though most of the library had been listed.

Behavior now

  • On a complete walk: import, purge stale rows, stamp lastSyncedAt (unchanged).
  • On an interrupted walk: import the entries already collected, skip the purge and lastSyncedAt stamp (unseen files are not stale), log an allowlisted result=partial record, and still surface the scan failure so the user can retry and complete it.
  • DOMAIN\user, user@domain, plain user, guest, and malformed separator input are covered by Rust unit tests.

Related issue

Refs #291.

Testing

  • flutter analyze --no-fatal-infos: no errors or warnings (same 28 pre-existing infos as main).
  • flutter test test/services/smb_service_parse_test.dart test/services/smb_service_download_test.dart test/services/network_cache_service_test.dart test/services/remote_metadata_backfill_test.dart: 38 passed.
  • Rust SMB module in an isolated crate against smb2 0.27.2: 8 passed, including the new account-format tests. Full cargo test is blocked on this Windows host by the existing soundtouch-sys C++ build issue.
  • Not hardware-tested: no Android device or SMB share available here.

Checklist

  • flutter analyze passes
  • flutter test passes (SMB/network suites pass; full Windows run has pre-existing failures)
  • Rust changes: cargo test --manifest-path rust/Cargo.toml passes (SMB module tests pass in isolation; full run blocked by existing soundtouch build issue on this host)
  • Built and ran the app if the change touches a playback path (not run; no device/share available)
  • Generated code regenerated and committed if bridge/drift/freezed models changed (none required)
  • CHANGELOG.md updated for user-facing changes
  • No secrets, keys, tokens, or machine-local files committed
  • One change per PR; no unrelated reformatting in the same diff
  • Hardware tested if the Rust audio engine or USB/DAC output changed (SMB module only)

- Split DOMAIN\\user and user@domain usernames into the account and domain fields NTLM expects.
- Keep songs already listed when an SMB walk is interrupted, skip the stale-row purge and lastSyncedAt stamp, then surface the scan failure so a later sync can finish.
- Document the account formats and interrupted-sync behavior.
@ultraelectronica
ultraelectronica changed the base branch from main to versionF November 7, 2026 10:54

@ultraelectronica ultraelectronica left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and approved for versionF testing.

  • Rust: split_account is unit-tested for plain, DOMAIN\user, user@domain, and malformed inputs; all 8 SMB tests and the full 369-test host suite pass.
  • Dart: partial walks import collected entries before rethrowing, and skip purge/lastSyncedAt so unseen files are not treated as stale. Targeted SMB/cache/backfill suites pass (38 tests).
  • CI: all checks green (4 Android Rust targets, host Rust tests, Flutter analyze + test).
  • Local full Flutter run: 1222 passed; only webdav_sync_integration_test.dart failed to load due to a pre-existing local Isar Core version mismatch (required 3.3.2, found 3.4.1), unrelated to this PR.
  • Hardware SMB validation (especially domain/UPN accounts) still pending; that is what versionF is for.

@ultraelectronica
ultraelectronica merged commit a9f94fb into moss-apps:versionF Nov 7, 2026
6 checks 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.

2 participants