feat: adding changes feed api#1859
Conversation
84dbbb3 to
e92c13d
Compare
| entry.setName(ev.getExtension().getName()); | ||
| entry.setVersion(ev.getVersion()); | ||
| entry.setTargetPlatform(ev.getTargetPlatform()); | ||
| entry.setState(ev.getState().name().toLowerCase()); |
There was a problem hiding this comment.
question: Is there a reason that we're modifying the enums on return? As these aren't aribitrary, we should probably just preserve the data as is and let the client do what they want with that data rather than make the assumption.
There was a problem hiding this comment.
so initially I wanted to match our convention, given that in other cases such as for the user role enum we return lowercased values, but thinking about it a bit more I'm realizing we do that there because these values weren't enums before.. so yeah I think returning uppercased enum values here its fine
wdyt @netomi ?
d724d81 to
1b69cee
Compare
…xtensionVersionFull Assisted-By: anthropic:claude-opus-4-7[1m]
10c725f to
7d8ad74
Compare
| var version = new ExtensionVersion(); | ||
| version.setState(ExtensionVersion.State.DELETED); | ||
|
|
||
| assertThrows(IllegalStateException.class, () -> version.setActive(false)); |
There was a problem hiding this comment.
nitpick: We probably don't want to block setting a deleted version to inactive. This would create a weird condition where we always have to setActive before setState for deleted extensions otherwise the platform would throw exceptions. It might make sense if we force a pseudo-immutable state on the entity when the state is deleted, but right now we only enforce state and activity
There was a problem hiding this comment.
In my followup PR this stats making more sense, but basically you should not be able to change the state of an extension that has been deleted.
Right now when you use setState(ExtensionVersion.State.DELETED) internally is setting it to inactive already.
Since the extension is deleted and therefore not accessible anymore setActive(false) will try to change the state to ExtensionVersion.State.INACTIVE that is not equal to deleted.
Related to #1854