Event Sourcing for JavaScript/TypeScript
yarn add @ddes/core @ddes/postgres
See example usage
JS/TypeScript framework for Distributed Event Sourcing & CQRS
Home Page: http://ddes.io
Event Sourcing for JavaScript/TypeScript
yarn add @ddes/core @ddes/postgres
See example usage
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
The npm token configured in the NPM_TOKEN
environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/
.
If you are using Two-Factor Authentication, make configure the auth-only
level is supported. semantic-release cannot publish with the default auth-and-writes
level.
Please make sure to set the NPM_TOKEN
environment variable in your CI with the exact value of the npm token.
Good luck with your project β¨
Your semantic-release bot π¦π
Aggregate -> Aggregate & AggregateInstance.
const MyAggregate = new Aggregate<MyStateType>({name: 'MyAggregate', eventStore: store, ...})
> await MyAggregate.load(key)
TypeError: Cannot convert undefined or null to object
at process._tickCallback (internal/process/next_tick.js:68:7)
at Job.hydrate (/src/node_modules/@ddes/core/lib/Aggregate.ts:388:54)
at Function.get snapshotCompatChecksum [as snapshotCompatChecksum] (/src/node_modules/@ddes/core/lib/Aggregate.ts:80:48)
at Array.map (<anonymous>)
at components.push.Object.keys.map.eventType (/src/node_modules/@ddes/core/lib/Aggregate.ts:82:28)
at Function.keys (<anonymous>)
Suggestion: if there are any errors with the snapshot, just log and ignore the error
const store = new AwsSnapshotStore({keyPrefix: 'foo'})
store.keyPrefix // now equals ''
await stores.main.getHeadCommit()
{}
Should return the most recent Commit from the store.
At one point it was not possible to commit new events due to version conflicts.
With retryOnVersionConflict()
it attempted x amount of times before it gave up.
Using MyAggregate.get('key'), returned version 159 as the latest.
Checking the 'events' table directly showed this for the last 2 commits:
[
{
aggregateType: 'MyType',
aggregateKey: 'myAggregateKey',
aggregateVersion: 160,
chronologicalKey: '20240216095823590:MyType:myAggregateKey:160',
chronologicalPartition: 'default',
events: [ [Object] ],
timestamp: 2024-02-16T09:58:23.590Z,
expiresAt: null
},
{
aggregateType: 'MyType',
aggregateKey: 'myAggregateKey',
aggregateVersion: 159,
chronologicalKey: '20240216095823593:MyType:myAggregateKey:159',
chronologicalPartition: 'default',
events: [ [Object] ],
timestamp: 2024-02-16T09:58:23.593Z,
expiresAt: null
}
]
Note the timestamps.
It seems version 160 was committed with a timestamp 3ms before version 159, which caused the chronological key to be out of order.
And every time a new commit happened, it fetched the 'last' one, got 159, attempted version + 1
and failed.
This was most likely caused by different replicas of the same api committing at the same time, but with slightly out-of-sync clocks, and ddes
using Date.now() for timestamps, which in turn is used for chronologicalKey.
AggregateRoot.ts#L200
Commit events, set local clock back a few seconds and commit new events.
Use a single source of truth for timestamps, the postgres db perhaps?
Allow specifying expiry time for commits
Currently, snapshots are not loaded unless useSnapshots
is specified in load like
Aggregate.load({id: 'foo', useSnapshots: true})
Is there any current examples folder in repo?
[]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.