Skip to content

Commit d2b5926

Browse files
committed
fix: remove large lists from shared sessions
1 parent 4531b8d commit d2b5926

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

packages/playground/src/utils/shareableSession.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,17 @@ function buildEnabledModulesDiff(modules: RootState["modules"]): Record<string,
6565
const enabled = !!moduleState && (moduleState as any).enabled === true;
6666
if (!enabled) continue;
6767
const defaults = (DEFAULT_MODULES as any)[name];
68-
const diff = diffToDefaults(moduleState, defaults);
68+
let diff = diffToDefaults(moduleState, defaults);
69+
// Drop large connection lists from share URLs; init state will recreate them.
70+
if (
71+
diff &&
72+
typeof diff === "object" &&
73+
(name === "joints" || name === "lines") &&
74+
"list" in diff
75+
) {
76+
const { list: _list, ...rest } = diff as any;
77+
diff = Object.keys(rest).length ? rest : {};
78+
}
6979
// Presence of the module key in the share URL implies "enabled".
7080
// Drop `enabled: true` to keep payload smaller.
7181
if (diff && typeof diff === "object" && "enabled" in diff) {

0 commit comments

Comments
 (0)