feat: SITES-40623 - token architecture in Spacecat#1819
feat: SITES-40623 - token architecture in Spacecat#1819
Conversation
|
This PR will trigger a minor release when merged. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🚨 Blocking Issues (Remove it after testing)
Logic / Correctness Issues
When no token exists, the code calls splitSuggestionsByGrantStatus once to compute the initial token total, then creates the token, and immediately calls it again to
} catch (err) {
Groups backlinks by url_to and assigns the group rank as Math.max(...items.map(getSuggestionRank)). Since sort is ascending (lower rank = higher priority), a group Code Quality
if (!Suggestion || !SuggestionGrant || !Token || !siteId || !opptyId || !config) return; Tests Tests are well-structured and cover the main paths: PLG enabled/disabled, error handling, grant filtering, autofix validation. The use of try/finally to restore One gap: no test for the concurrent token-creation path (two simultaneous requests where token is initially null). |
Summary
Jira - https://jira.corp.adobe.com/browse/SITES-40623
collections.
handler is enabled for the site (via Configuration).
failure).
@adobe/spacecat-shared-data-access.
Changes
Source
grants top ungranted suggestions.
validation in autofixSuggestions.
Tests
limiting, error paths).
Test plan
Please ensure your pull request adheres to the following guidelines:
describe here the problem you're solving.
If the PR is changing the API specification:
yet. Ideally, return a 501 status code with a message explaining the feature is not implemented yet.
If the PR is changing the API implementation or an entity exposed through the API:
If the PR is introducing a new audit type:
Related Issues
Thanks for contributing!