File tree Expand file tree Collapse file tree
tools/diagnostics-app/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @powersync/diagnostics-app ' : minor
3+ ---
4+
5+ Fixed redirect for removed /login route to go to home page. Fixed token query parameter deep-link and stale credential display after re-login.
Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ export default function SyncDiagnosticsPage() {
117117 tokenPayload : decodeTokenPayload ( credentials . token )
118118 } ;
119119 } ,
120- staleTime : Infinity
120+ staleTime : 0 ,
121+ refetchOnMount : 'always'
121122 } ) ;
122123
123124 const { data : stats , isLoading } = useTanstackQuery ( {
Original file line number Diff line number Diff line change @@ -145,13 +145,6 @@ export async function connect() {
145145 notifySyncChange ( ) ;
146146 await sync . connect ( { params, clientImplementation : client } ) ;
147147 await schemaManager . refreshSchemaNow ( db ) ;
148- if ( ! sync . syncStatus . connected ) {
149- const error = sync . syncStatus . dataFlowStatus . downloadError ?? new Error ( 'Failed to connect' ) ;
150- lastConnectionError = error ;
151- notifySyncChange ( ) ;
152- await sync . disconnect ( ) ;
153- throw error ;
154- }
155148}
156149
157150export async function clearData ( ) {
Original file line number Diff line number Diff line change 1- import { createRootRoute , Outlet } from '@tanstack/react-router' ;
1+ import { createRootRoute , Outlet , Navigate } from '@tanstack/react-router' ;
22import { SystemProvider } from '@/components/providers/SystemProvider' ;
33import { ThemeProviderContainer } from '@/components/providers/ThemeProviderContainer' ;
44
55export const Route = createRootRoute ( {
6- component : RootComponent
6+ component : RootComponent ,
7+ notFoundComponent : ( ) => < Navigate to = "/" />
78} ) ;
89
910function RootComponent ( ) {
Original file line number Diff line number Diff line change 11import { createFileRoute , redirect , useNavigate } from '@tanstack/react-router' ;
2- import { connector } from '@/library/powersync/ConnectionManager' ;
2+ import { connector , connect } from '@/library/powersync/ConnectionManager' ;
3+ import { localStateDb } from '@/library/powersync/LocalStateManager' ;
34import { getTokenEndpoint } from '@/library/powersync/TokenConnector' ;
45import { z } from 'zod' ;
56import { Formik , FormikErrors } from 'formik' ;
@@ -30,7 +31,9 @@ export const Route = createFileRoute('/')({
3031 throw new Error ( 'endpoint is required' ) ;
3132 }
3233
33- await connector . signIn ( { token : search . token , endpoint } ) ;
34+ await localStateDb . init ( ) ;
35+ await connector . saveCredentials ( { token : search . token , endpoint } ) ;
36+ await connect ( ) ;
3437
3538 throw redirect ( { to : '/sync-diagnostics' } ) ;
3639 }
@@ -86,7 +89,8 @@ function LandingPage() {
8689 if ( endpoint == null ) {
8790 throw new Error ( 'endpoint is required' ) ;
8891 }
89- await connector . signIn ( { token : values . token , endpoint } ) ;
92+ await connector . saveCredentials ( { token : values . token , endpoint } ) ;
93+ await connect ( ) ;
9094 navigate ( { to : '/sync-diagnostics' } ) ;
9195 } catch ( ex : any ) {
9296 console . error ( ex ) ;
You can’t perform that action at this time.
0 commit comments