experiments in a post-browser web
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix tile-preload: defer tile:ready to next event loop tick for lazy command race

+9 -4
+9 -4
backend/electron/tile-preload.cts
··· 104 104 throw new Error('Tile token validation failed. Tile may have been revoked.'); 105 105 } 106 106 107 - // Signal ready to main process 108 - ipcRenderer.send('tile:ready', { tileId, tileEntry }); 109 - 110 - return { capabilities: grantedCapabilities }; 107 + // Defer tile:ready to the next event-loop tick so any synchronous 108 + // post-initialize code in background.html (e.g. extension.init() + 109 + // api.commands.register()) has a chance to complete before the lazy 110 + // system's hasSubscriber check fires. 111 + const result = { capabilities: grantedCapabilities }; 112 + setTimeout(() => { 113 + ipcRenderer.send('tile:ready', { tileId, tileEntry }); 114 + }, 0); 115 + return result; 111 116 }; 112 117 113 118 /**