Fix critical issues C1-C5, C7, H1, H2, H4, H10
C1+C7: Cache purge now passes user_id and works for view-path mutations. Extracted _purge_cache_for_invalidation() shared helper used by both RPC and view-path branches. C2: initSession retries 3x with backoff. Resets on total failure so next call tries again instead of permanently broken CSRF. C3: SSR template backend injects __MIZAN_SSR_DATA__ script tag with serialized props for client-side hydration. C4: SSR bridge uses _write_lock to serialize stdin writes from concurrent Django threads. Prevents JSON interleaving. C5: SSR bridge registers atexit handler for process cleanup. No more orphaned Bun processes on Django reload/shutdown. H1: pendingScoped changed from Map to Array — multiple scoped invalidations for the same context no longer overwrite. H2: registerContext uses stableKey() (sorted JSON) instead of bare JSON.stringify. Property order no longer matters. H4: Named context providers skip refetch if SSR data exists (matches global context behavior). H10: _meta always assigned as fresh dict, preventing shared-dict mutation across ServerFunction subclasses. 373 Django + 33 React tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -106,7 +106,7 @@ export function generateReactAdapter(schema) {
|
||||
const deps = paramEntries.map(([pName]) => `params.${pName}`)
|
||||
lines.push(` }, [${deps.join(', ')}])`)
|
||||
lines.push('')
|
||||
lines.push(` useEffect(() => { refetch() }, [refetch])`)
|
||||
lines.push(` useEffect(() => { if (!data) refetch() }, [data, refetch])`)
|
||||
lines.push(` useEffect(() => registerContext('${ctxName}', params, refetch), [${deps.join(', ')}, refetch])`)
|
||||
lines.push('')
|
||||
lines.push(` return <${p}Ctx.Provider value={data}>{children}</${p}Ctx.Provider>`)
|
||||
|
||||
Reference in New Issue
Block a user