@@ -30,6 +30,7 @@ import {
3030 resolveRootManifest ,
3131 setResolverAssetHubProvider ,
3232 waitForAssetHubFinalized ,
33+ waitForPeopleFinalized ,
3334} from "@dotli/resolver/resolve" ;
3435import { onSmoldotFatal } from "@dotli/resolver/smoldot" ;
3536import { m } from "@dotli/metrics/metrics" ;
@@ -214,6 +215,24 @@ async function presync(): Promise<void> {
214215 port . postMessage ( readyMsg ) ;
215216 }
216217 pendingPorts . length = 0 ;
218+
219+ // Warm the People chain in the background. Legacy-account auth reads the
220+ // username -> account map on People, and on a cold start that read races
221+ // the parachain warp sync (the source of the intermittent failures). Start
222+ // syncing it now so it is ready by the time auth runs. People is not needed
223+ // for resolution, so this must not gate the ready signal above.
224+ swLog ( "Warming People chain in background..." ) ;
225+ void waitForPeopleFinalized ( ( msg ) => {
226+ swLog ( `People warm status: ${ msg } ` ) ;
227+ } )
228+ . then ( ( ) => {
229+ swLog ( "People chain warmed" ) ;
230+ } )
231+ . catch ( ( err : unknown ) => {
232+ swLog (
233+ `People chain warm failed (retried on demand): ${ serializeError ( err ) } ` ,
234+ ) ;
235+ } ) ;
217236 } catch ( err : unknown ) {
218237 const msg = serializeError ( err ) ;
219238 swError ( `Pre-sync failed: ${ msg } ` ) ;
0 commit comments