aboutsummaryrefslogtreecommitdiffstats
path: root/tools/seed-cache-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-09-07 00:09:00 -0700
committerAdam Soltys <[email protected]>2026-09-07 00:09:00 -0700
commitcbce9a56e2ed41cf8586a467af5ab5a5f43bc430 (patch)
treefee875b2b5ac5cf6a7a3126c73ff0b3054a01ea5 /tools/seed-cache-test.js
parent989e29302e479277fb18ee105874c9a1eeb00be5 (diff)
downloadcoinosv3-cbce9a56e2ed41cf8586a467af5ab5a5f43bc430.tar.gz
coinosv3-cbce9a56e2ed41cf8586a467af5ab5a5f43bc430.zip
Stop tracking the local runtime session store (db/).
db/sessions/ is a local server-side session store (398 binary files) that isn't part of the wallet build and was cluttering the working tree; one file (2029240f…) had been committed by accident in 3a94783. Untrack that file (kept on disk) and gitignore /db/ so the store stays local. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01MGzU12QrAA4G6BYGzGVdXz
Diffstat (limited to 'tools/seed-cache-test.js')
0 files changed, 0 insertions, 0 deletions
Text.Whitespace */ .highlight .mb { color: #00D; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #00D; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #00D; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #00D; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #00D; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #D20; background-color: #FFF0F0 } /* Literal.String.Affix */ .highlight .sb { color: #D20; background-color: #FFF0F0 } /* Literal.String.Backtick */ .highlight .sc { color: #D20; background-color: #FFF0F0 } /* Literal.String.Char */ .highlight .dl { color: #D20; background-color: #FFF0F0 } /* Literal.String.Delimiter */ .highlight .sd { color: #D20; background-color: #FFF0F0 } /* Literal.String.Doc */ .highlight .s2 { color: #D20; background-color: #FFF0F0 } /* Literal.String.Double */ .highlight .se { color: #04D; background-color: #FFF0F0 } /* Literal.String.Escape */ .highlight .sh { color: #D20; background-color: #FFF0F0 } /* Literal.String.Heredoc */ .highlight .si { color: #33B; background-color: #FFF0F0 } /* Literal.String.Interpol */ .highlight .sx { color: #2B2; background-color: #F0FFF0 } /* Literal.String.Other */ .highlight .sr { color: #080; background-color: #FFF0FF } /* Literal.String.Regex */ .highlight .s1 { color: #D20; background-color: #FFF0F0 } /* Literal.String.Single */ .highlight .ss { color: #A60; background-color: #FFF0F0 } /* Literal.String.Symbol */ .highlight .bp { color: #038 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #06B; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #369 } /* Name.Variable.Class */ .highlight .vg { color: #D70 } /* Name.Variable.Global */ .highlight .vi { color: #33B } /* Name.Variable.Instance */ .highlight .vm { color: #369 } /* Name.Variable.Magic */ .highlight .il { color: #00D; font-weight: bold } /* Literal.Number.Integer.Long */
// Canceling a new post closes the composer and discards every part of its
// saved state, including a late attachment result.
import assert from 'node:assert/strict';

const source = await Bun.file('src/features/messages.js').text();
const start = source.indexOf('function cancelPost()');
const end = source.indexOf('\n  }', start);
const cancel = source.slice(start, end);
assert(start > 0, 'post cancel handler exists');
assert(cancel.includes('postAttachGeneration++'), 'late uploads are invalidated');
assert(cancel.includes('ui.profCompose = null'), 'composer is closed');
assert(cancel.includes('ui.postMedia = []'), 'pending attachment metadata is removed');
assert(cancel.includes('ui.postPreview = false'), 'preview state is removed');
assert(cancel.includes('discardDraft(POST_DRAFT)'), 'persisted draft is removed immediately');
assert(source.includes("composeText().length > 20"), 'drafts over 20 characters require confirmation');
assert(source.includes("ui.postUploading || (ui.postMedia || []).length"), 'attachments require confirmation');
assert(source.includes("onClick: requestCancelPost }, t('cancel')"), 'Cancel button uses the guarded discard handler');
assert(source.includes("onClick: cancelPost }, t('postDiscard')"), 'warning can confirm the discard');

console.log('✓ Cancel warns for substantial drafts, then closes the form and removes its complete saved draft');