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

NoReaction instead of Nothing #1554

Merged
merged 22 commits into from
Oct 10, 2024
Merged

NoReaction instead of Nothing #1554

merged 22 commits into from
Oct 10, 2024

Conversation

alexander-yevsyukov
Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Oct 9, 2024

This PR sorts out the matter of "empty" event messages and commands, addressing the issue #1335 and related matters.

New types

The event message type spine.server.event.NoReaction was introduced instead of spine.server.model.Nothing.
The command message type spine.server.command.DoNothing was introduced instead of spine.server.model.DoNothing. Old types were deprecated.

Previously introduced type aliases NothingHappened and NoReactions were deprecated in favor of io.spine.server.event.NoReaction.

Convenience extensions for returning EitherOf2

EventMessage type got extension functions asA() and asB() converting it to corresponding instance of EitherOf2.

... because of lack of support of field references in new Validation.
We cannot say "nothing happened" in response to an event, because something indeed happened. So, `NoReaction` is a better way of describing the case when we do not want to react on an event.
…-reaction-etc

# Conflicts:
#	build.gradle.kts
#	buildSrc/src/main/kotlin/io/spine/internal/dependency/ProtoData.kt
#	buildSrc/src/main/kotlin/io/spine/internal/dependency/Spine.kt
#	buildSrc/src/main/kotlin/io/spine/internal/dependency/Validation.kt
#	config
#	dependencies.md
@alexander-yevsyukov alexander-yevsyukov self-assigned this Oct 9, 2024
@alexander-yevsyukov alexander-yevsyukov changed the title Improvements to NoReaction NoReaction instead of Nothing Oct 9, 2024
@alexander-yevsyukov
Copy link
Contributor Author

@armiol, this PR depends on this version of McJava .

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 73.68421% with 5 lines in your changes missing coverage. Please review.

Please upload report for BASE (master@0a4b2fb). Learn more about missing BASE report.
Report is 23 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1554   +/-   ##
=========================================
  Coverage          ?   89.76%           
  Complexity        ?     5022           
=========================================
  Files             ?      646           
  Lines             ?    15747           
  Branches          ?      920           
=========================================
  Hits              ?    14136           
  Misses            ?     1279           
  Partials          ?      332           

@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review October 10, 2024 11:12
@alexander-yevsyukov alexander-yevsyukov merged commit 6f84948 into master Oct 10, 2024
7 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the no-reaction-etc branch December 14, 2024 21:07
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

Successfully merging this pull request may close these issues.

2 participants