Closed farskipper closed 8 months ago
A note on cuid
in response to your not knowing "if people depend on the structure of the ids". We do not depend on the internal structure of an ECI. It is used only as an opaque identifier to locate the corresponding pico and policy.
We do sort the list of channels by the identifier, but this is solely to expedite finding a channel in the list when we know its identifier and are looking for it for some reason (usually to see its policy).
As a result, there should be no adverse consequence of moving to cuid2
. Pre-existing channels (created before an upgrade) would not have their identifiers changed, but channels created after an update would have new identifiers. The fact that channel identifiers currently sort in the order they were created would no longer be a fact, and that might impact certain pico developer practices. I sometimes use that fact, but could easily work around the change. It might be helpful to include a time
value in each channel so that they could be sorted by it, but that could be an enhancement request after an upgrade.
Bottom line is that cuid
could be upgraded to cuid2
for security purposes without a disruption big enough to be classified as "breaking".
@b1conrad Ok, good to know the cuid structure is not a dependency.
Another alternative is nodejs's built-in UUID implementation.
To store the channel creation time, it can be added to pico-framework While in there, it'd be good to also store the last updated time, and do the same on the Pico object.
Put a copy of an existing db
folder in place, and started with
PICO_ENGINE_HOME=. PORT=3002 node dist/cli.js
and got a spate of strange error messages like
Error: Ruleset io.picolabs.subscription does not have query function "established"
at Pico.doTxn (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine-core/node_modules/pico-framework/dist/src/Pico.js:395:31)
at PicoQueue.doWork (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine-core/node_modules/pico-framework/dist/src/PicoQueue.js:47:35)
at Timeout._onTimeout (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine-core/node_modules/pico-framework/dist/src/PicoQueue.js:22:31)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
in the log, presumably for the established subscriptions among the picos. Tried the Testing tab and got a similar message about there not being a query function for __testing
.
So, assumption is that that ruleset needs to be recompiled (and that doesn't trigger automatically because both engines are still at the same version until we merge and publish a new version number).
Also got one occurrence of this error
TypeError: ruleset.ruleset.init is not a function
at CorePico.use (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine-core/dist/CorePico.js:28:43)
at Object.useModule (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine-core/dist/makeKrlCtx.js:54:28)
at Object.init (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine/rulesets/1.3.0/4a/03/4a03e1844c573fb98990f2e884965631fe4ae5f8b7bb1451310c9c937816efab.js:251:16)
at Pico.installBase (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine-core/node_modules/pico-framework/dist/src/Pico.js:259:35)
at Pico.install (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine-core/node_modules/pico-framework/dist/src/Pico.js:238:48)
at Object.install (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine-core/node_modules/pico-framework/dist/src/RulesetContext.js:45:25)
at Object.install (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine-core/dist/modules/ctx.js:120:30)
at async Object.body (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine/rulesets/1.3.0/1b/df/1bdf14cdcdc62c15ed75c33c391b77ca82097e218f16b12c6b55bdf690d67e3e.js:759:22)
and stopped the engine. (Looking, and that happens to be io.picolabs.wrangler
FWIW.)
Removed rulesets
and rulesets-db
and restarted engine. Everything seemed to work. Removed db
and the rulesets*
folders and recopied the db
into place to start again from scratch. It stopped with this
Failed to start engine.
TypeError: rs.init is not a function
at Pico.installBase (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine-core/node_modules/pico-framework/dist/src/Pico.js:259:35)
at Pico.install (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine-core/node_modules/pico-framework/dist/src/Pico.js:238:48)
at startEngine (/Users/bruceconrad/Documents/b1conrad/dependency-updates/pico-engine/packages/pico-engine/dist/index.js:54:27)
But I just ran it again, and it seemed to work. Removed the rulesets*
folders and started it with the same failure. Trying again... Seems to be working. Looking at some picos... Seems to be running.
What changed by package
cuid
(see below)standard
(see below)standard
(see below)cuid,bs58,normalize-url,p-memoize,random-words
(see below)cuid
androtating-file-stream
(see below)Dependencies not updated