You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@fabiojose I agree that events should probably be immutable - aside from a well-defined path for converting from/to spec versions. Given how the repo has been evolving, how do you think this issue should progress?
I'm going to mark this a stalled for now. TypeScript users now have Object.freeze for regular objects. However, that doesn't work for the CloudEvent class. We'd need to add a freeze() method to the class itself to prevent modification. This is because the setters on the class delegate to this.spec.
Activity
lance commentedon May 9, 2020
@fabiojose I agree that events should probably be immutable - aside from a well-defined path for converting from/to spec versions. Given how the repo has been evolving, how do you think this issue should progress?
grant commentedon May 18, 2020
If we use JSON for CloudEvents, then we can just
Object.freezeour event data to make it immutable.Requires #65.
lance commentedon May 29, 2020
I'm going to mark this a stalled for now. TypeScript users now have
Object.freezefor regular objects. However, that doesn't work for theCloudEventclass. We'd need to add afreeze()method to the class itself to prevent modification. This is because the setters on the class delegate tothis.spec.github-actions commentedon Jun 29, 2020
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
grant commentedon Jul 1, 2020
Marking all
CloudEventfields asreadonlyshould be a solution.This is very common and recommended in TypeScript. See vscode's source for examples.
lance commentedon Jul 3, 2020
Weird that the bot closed this
lance commentedon Jul 21, 2020
While not exposed via an actual builder, I think #234 should satisfy this issue. Closing.