Skip to content

Conversation

salaboy
Copy link
Collaborator

@salaboy salaboy commented Oct 1, 2025

Description

Add new method signature to support metadata map, I've added a test that validates that the custom metadata is added.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1569

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@salaboy salaboy requested review from a team as code owners October 1, 2025 11:05
@salaboy salaboy force-pushed the 1569-save-metadata branch from 1da2f75 to 62f1fda Compare October 1, 2025 11:06
@salaboy salaboy force-pushed the 1569-save-metadata branch 2 times, most recently from 46da31f to f7b2be6 Compare October 1, 2025 15:34
@salaboy salaboy force-pushed the 1569-save-metadata branch from 9746e04 to d6fe7d5 Compare October 2, 2025 07:25
Copy link

codecov bot commented Oct 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.51%. Comparing base (d759c53) to head (d396b5c).
⚠️ Report is 228 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1570      +/-   ##
============================================
+ Coverage     76.91%   78.51%   +1.60%     
- Complexity     1592     1916     +324     
============================================
  Files           145      215      +70     
  Lines          4843     5833     +990     
  Branches        562      650      +88     
============================================
+ Hits           3725     4580     +855     
- Misses          821      916      +95     
- Partials        297      337      +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@artur-ciocanu artur-ciocanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@salaboy nice job! I just think we should be careful not to change the incoming parameter. For example if someone would send an unmodifiable map as parameter, it will result in a runtime exception.

*/
@Override
public Mono<Void> saveState(String storeName, String key, String etag, Object value, Map<String, String> meta,
StateOptions options) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is dangerous to modify the incoming method parameter. I would rather make a copy and add the content type if value is not null.

}

if (value != null) {
meta.put("contentType", stateSerializer.getContentType());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the key already exists? Is it ok to overwrite it?

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.

No way to pass state metadata into saveState method
4 participants