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

fix: infinite TTLs are not supported anymore, forward ttl=0 #170

Merged
merged 5 commits into from
Jun 25, 2024

Conversation

moritzraho
Copy link
Member

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (94e34ad) to head (fbf63b9).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #170   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          247       251    +4     
  Branches        42        43    +1     
=========================================
+ Hits           247       251    +4     

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

sdkDetails: { key, valueLength: value.length, options, errors }
}))
}
if (ttl !== undefined && (ttl < 0 || ttl > MAX_TTL_SECONDS)) {
Copy link
Member

Choose a reason for hiding this comment

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

too bad AJV validator can't have a min max :/

Copy link
Member Author

Choose a reason for hiding this comment

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

yes AJV has a min max, but the error message is not nice...

AioCoreSDKError [AdobeStateLibError]: [AdobeStateLib:ERROR_BAD_ARGUMENT] WARNING: keyword 'minimum' was not handled for formatting: {
  "instancePath": "/ttl",
  "schemaPath": "#/properties/ttl/minimum",
  "keyword": "minimum",
  "params": {
    "comparison": ">=",
    "limit": 0
  },
  "message": "must be >= 0"
}

I wanted to make it clear that infinite ttls are not supported anymore!

Copy link
Member

Choose a reason for hiding this comment

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

actually we can add the support in our code here, but maybe for next time:

function formatAjvErrors (errors) {

Copy link
Member Author

Choose a reason for hiding this comment

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

great maybe next time, as this is a custom error anyways

@moritzraho moritzraho changed the title fix: infinite TTLs are not supported anymore fix: infinite TTLs are not supported anymore, forward ttl=0 Jun 20, 2024
@moritzraho moritzraho merged commit 28541c2 into main Jun 25, 2024
9 checks passed
@moritzraho moritzraho deleted the fix/infinite-ttl branch June 25, 2024 10:42
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.

3 participants