Conversation
📦 Tauri Desktop Builds Ready!The desktop applications have been built and are ready for testing. Download Artifacts:🐧 Linux x64: Download Stirling-PDF-linux-x86_64 (.deb, .AppImage) - 215.3 MB Built from commit 9a8e5dd |
🌐 TOML Translation Verification Summary🔄 Reference Branch:
|
…tirling-PDF into bug/connectionModeFixes
- Rust guard preserves server_config/lock when set_connection_mode is
called on a locked deployment; still writes setup_completed so
onboarding doesn't repeat on every restart
- switchToLocal() preserves server_config on locked deployments;
loadConfig() respects LOCAL_MODE_STORAGE_KEY regardless of stored mode,
fixing auto re-login after sign-out on locked deployments
- selfHostedServerMonitor.start() consolidated into switchToSelfHosted()
as the single calling point
- Removed automatic sign-in modal on every launch with expired JWT;
replaced with a one-shot prompt per expiry cycle using a localStorage
flag cleared on next successful sign-in
- selfHostedServerMonitor.stop() called immediately on leaving selfhosted
mode so the status dot resets correctly
- First-launch locked deployments skip switchToLocal() to avoid clearing
server_config from the store
- Suppress error toast on license-info 500s (LicenseContext handles silently)
…tirling-PDF into bug/connectionModeFixes
✅ Backend License Check PassedAll backend dependencies have valid and allowed licenses. The backend license report has been updated successfully. |
| {children} | ||
| </div> | ||
| {hovered && ( | ||
| <div className="absolute left-1/2 -translate-x-1/2 bottom-[calc(100%+8px)] text-white whitespace-nowrap pointer-events-none z-[1000] shadow-lg rounded-[var(--mantine-radius-sm)] text-[.8rem] bg-[var(--mantine-color-dark-7)] px-[10px] py-[6px]"> |
There was a problem hiding this comment.
inline z index used here. These really long class names are hard to read. Should we be using theme based css for this. Are they all actually needed. Should each one even be a component that we can reuse?
| if (!authChecked || !pendingSignIn) return; | ||
| window.dispatchEvent(new CustomEvent(OPEN_SIGN_IN_EVENT, { detail: pendingSignIn })); | ||
| setPendingSignIn(null); | ||
| window.dispatchEvent(new CustomEvent(OPEN_SIGN_IN_EVENT, { detail: { locked: false } })); |
There was a problem hiding this comment.
Why are we no longer conditional on locked?
There was a problem hiding this comment.
Double check the version bump is needed in this PR and is still correct
…ing comments were added to explain the bahviour change in AppProviders.tsx
🚀 V2 Auto-Deployment Complete!Your V2 PR with embedded architecture has been deployed! 🔗 Direct Test URL (non-SSL) http://54.175.155.236:5998 🔐 Secure HTTPS URL: https://5998.ssl.stirlingpdf.cloud This deployment will be automatically cleaned up when the PR is closed. 🔄 Auto-deployed for approved V2 contributors. |
connection.rs
Added a guard at the top of set_connection_mode: if lock_connection_mode is already true in the store, the command returns early without touching connection_mode, server_config, or the lock flag. It still writes setup_completed: true so the onboarding doesn't repeat on every restart. Previously there was no Rust-side protection, so any JS call could silently overwrite an admin config.
connectionModeService.ts
Four changes:
loadConfig() now checks LOCAL_MODE_STORAGE_KEY regardless of the stored mode ('saas' or 'selfhosted'). Previously it only checked when mode === 'saas', so locked deployments (which keep 'selfhosted' in the store) would ignore the flag and auto-login after sign-out.
switchToLocal() now preserves server_config in the in-memory config when the deployment is locked, so the sign-in form can still show the correct URL after the user goes offline. Also removes the old stirling-provisioned-server-url localStorage workaround that was patching over this gap.
switchToSaaS() and switchToSelfHosted() both now clear JWT_EXPIRED_PROMPTED_KEY on successful sign-in, enabling the one-shot modal to fire again next time the JWT expires.
switchToSelfHosted() now calls selfHostedServerMonitor.start() directly — consolidated from three separate call sites in SetupWizard into this single call.
AppProviders.tsx
Previously, on every launch with an expired JWT, it set pendingSignIn and the modal appeared unconditionally. Now it checks JWT_EXPIRED_PROMPTED_KEY in localStorage first — sets the flag and shows the modal only if the flag isn't already set. switchToSaaS/switchToSelfHosted clear the flag on sign-in so the next expiry shows it again.
Previously, locked deployments (lock_connection_mode: true) would set pendingSignIn = { locked: true } which opened the modal in a non-dismissible locked state. Now locked deployments silently stay in their configured mode — the user signs in via Settings when ready.
Previously all first launches called switchToLocal(). Now it reads the config first — if locked with a server URL, it starts the backend and sets selfhosted mode without touching the store (which would wipe server_config). Normal first launches still go through switchToLocal().
Previously the monitor effect only started it (when connectionMode === 'selfhosted'). Now it also calls selfHostedServerMonitor.stop() on the cleanup path whenever the mode is anything other than selfhosted, so the status dot resets correctly on sign-out.
DesktopOnboardingModal.tsx
Removed the isLocked state and the effect that suppressed the modal for locked deployments. Previously, locked deployments skipped the onboarding entirely and relied on a non-dismissible SignInModal — but that modal no longer auto-fires. Now all deployments see the onboarding. dismissFinal now calls switchToLocal() so dismissing without signing in leaves the app in a usable local mode rather than stranded.
SetupWizard/index.tsx
Three changes:
loadLockedConfig() drops the localStorage.getItem('stirling-provisioned-server-url') fallback — now unnecessary since switchToLocal() preserves server_config in memory.
"Connect to a different server" is now always rendered on the unreachable screen. When locked it shows as a custom disabled element with a hover tooltip ("Your organisation has restricted this app to a specific server").
Use local tools instead" on the self-hosted login screen is now always visible — previously it was only shown on unlocked deployments and hidden on locked ones, which was the opposite of what was needed
licenseService.ts
Added suppressErrorToast: true to the getLicenseInfo request. The LicenseContext already handles failures gracefully via error state — the global handleHttpError interceptor was showing a noisy "Server error" toast for the 500 response when opening Settings in local mode.
setup-env.ts / .env.desktop.example
Added getOptionalKeys() which reads # optional inline comments from example env files. Keys marked optional are excluded from the missing-key check in ensureEnvFile. Used to mark VITE_DEV_SIMULATE_EXPIRED_JWT as optional so it doesn't block dev builds that haven't set it.