fix(StatePart): Use stable JSON stringify for state hashing; update dependencies and tooling

This commit is contained in:
2025-09-12 22:08:35 +00:00
parent 07bfbfd393
commit 81ca32cdef
5 changed files with 2713 additions and 969 deletions

View File

@@ -1,5 +1,13 @@
# Changelog # Changelog
## 2025-09-12 - 2.0.27 - fix(StatePart)
Use stable JSON stringify for state hashing; update dependencies and tooling
- Replace smartjson.stringify with smartjson.stableOneWayStringify when creating SHA256 state hashes to ensure deterministic hashing and avoid duplicate notifications for semantically identical states.
- Bump runtime dependencies: @push.rocks/smarthash -> ^3.2.6, @push.rocks/smartjson -> ^5.2.0.
- Bump dev tooling versions: @git.zone/tsbuild -> ^2.6.8, @git.zone/tsbundle -> ^2.5.1, @git.zone/tstest -> ^2.3.8.
- Add local .claude/settings.local.json configuration for allowed permissions (local tooling/settings file).
## 2025-08-16 - 2.0.26 - fix(ci) ## 2025-08-16 - 2.0.26 - fix(ci)
Add local Claude settings file to allow helper permissions for common local commands Add local Claude settings file to allow helper permissions for common local commands

View File

@@ -14,17 +14,17 @@
"buildDocs": "tsdoc" "buildDocs": "tsdoc"
}, },
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.6.4", "@git.zone/tsbuild": "^2.6.8",
"@git.zone/tsbundle": "^2.4.0", "@git.zone/tsbundle": "^2.5.1",
"@git.zone/tsrun": "^1.3.3", "@git.zone/tsrun": "^1.3.3",
"@git.zone/tstest": "^2.3.1", "@git.zone/tstest": "^2.3.8",
"@push.rocks/tapbundle": "^6.0.3", "@push.rocks/tapbundle": "^6.0.3",
"@types/node": "^22.7.4" "@types/node": "^22.7.4"
}, },
"dependencies": { "dependencies": {
"@push.rocks/lik": "^6.2.2", "@push.rocks/lik": "^6.2.2",
"@push.rocks/smarthash": "^3.2.0", "@push.rocks/smarthash": "^3.2.6",
"@push.rocks/smartjson": "^5.0.20", "@push.rocks/smartjson": "^5.2.0",
"@push.rocks/smartpromise": "^4.2.3", "@push.rocks/smartpromise": "^4.2.3",
"@push.rocks/smartrx": "^3.0.10", "@push.rocks/smartrx": "^3.0.10",
"@push.rocks/webstore": "^2.0.20" "@push.rocks/webstore": "^2.0.20"

3660
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartstate', name: '@push.rocks/smartstate',
version: '2.0.26', version: '2.0.27',
description: 'A package for handling and managing state in applications.' description: 'A package for handling and managing state in applications.'
} }

View File

@@ -79,7 +79,7 @@ export class StatePart<TStatePartName, TStatePayload> {
return; return;
} }
const createStateHash = async (stateArg: any) => { const createStateHash = async (stateArg: any) => {
return await plugins.smarthashWeb.sha256FromString(plugins.smartjson.stringify(stateArg)); return await plugins.smarthashWeb.sha256FromString(plugins.smartjson.stableOneWayStringify(stateArg));
}; };
const currentHash = await createStateHash(this.stateStore); const currentHash = await createStateHash(this.stateStore);
if ( if (