feat: adding changes feed api#1859
Conversation
84dbbb3 to
e92c13d
Compare
|
|
||
| public void setActive(boolean active) { | ||
| this.active = active; | ||
| setState(active ? State.ACTIVE : State.INACTIVE); |
There was a problem hiding this comment.
issue: If for whatever reason the Version gets marked as DELETED without being set as inactive, this would clobber the DELETED flag on being set inactive. This would also clear a deleted flag if the flag was set DELETED first then had the active flag set to false. I think that setting the state automatically can be a bit dangerous as it could create non-obvious side effects, and we should instead just be intentional.
|
|
||
| var content = query.fetch().map(row -> { | ||
| var extVersion = toExtensionVersionFull(row); | ||
| extVersion.setActive(row.get(EXTENSION_VERSION.ACTIVE)); |
There was a problem hiding this comment.
suggestion: This should probably be in the toExtensionVersionFull method as they aren't protected/sensitive fields. If you do that, this section could just become var content = query.fetch().map(this::toExtensionVersionFull);
| 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.
Related to #1854