Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure correct typespecs of Events and idempotence of decode. #30

Open
4 tasks
cognivore opened this issue Sep 16, 2023 · 1 comment
Open
4 tasks

Ensure correct typespecs of Events and idempotence of decode. #30

cognivore opened this issue Sep 16, 2023 · 1 comment
Assignees

Comments

@cognivore
Copy link
Contributor

Why?

Currently, vents seem to have wrong typespecs, they only encode the target data type, ignoring the incoming raw data type we decode. This is a bug.

Furthermore, when we decode(decode(x)), we crash. Which is suboptimal, so decode should be made idempotent unless there is something that guarantees that decoded events will never be decoded. In that case, in line with the principle of fail fast, fail loud, decode should NOT be made idempotent, but still should be at least guarded.

How?

  • Take a look at this commit.
  • Assess if decode should be idempotent or if our system guarantees that a decoded event shall never be decoded.
  • If a decoded event shall never be decoded, remove the second head of decode function in this commit, but leave the pattern match.
  • Replicate these changes across all the events in the system.
@cognivore
Copy link
Contributor Author

1f17992

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants