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

Bumps sirius-biz and applies breaking changes #2064

Closed
wants to merge 2 commits into from
Closed

Conversation

idlira
Copy link
Contributor

@idlira idlira commented Dec 16, 2024

Description

Marking as BREAKING since this applies a breaking change from sirius-biz.

Additional Notes

Checklist

  • Code change has been tested and works locally
  • Code was formatted via IntelliJ and follows SonarLint & best practices

@idlira idlira added 💣 BREAKING CHANGE Contains non-backwards compatible changes to public methods or changes the behavior of existing code 🛠️ Maintenance Translations, Code Cleanup, ... labels Dec 16, 2024
Copy link
Member

@sabieber sabieber left a comment

Choose a reason for hiding this comment

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

Don't think the idea was to simply use fetchCachedValue everywhere, but rather look at each individual usage and choose the correct/safer variant

@@ -109,7 +109,7 @@ public class SQLVariant extends SQLEntity implements BlobVariant {

@AfterDelete
protected void onDelete() {
SQLBlob sqlBlob = sourceBlob.fetchValue();
SQLBlob sqlBlob = sourceBlob.fetchCachedValue();
Copy link
Member

Choose a reason for hiding this comment

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

Question: Doesn't use of the ref-cache here potentially lead to trying to delete a blob that may be already deleted otherwise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, will review the places.

@@ -181,7 +181,7 @@ protected List<T> querySAMLTenants() {

private void verifyUser(SAMLResponse response, UserInfo user) {
U account = user.getUserObject(getUserClass());
T tenant = account.getTenant().fetchValue();
T tenant = account.getTenant().fetchCachedValue();
Copy link
Member

Choose a reason for hiding this comment

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

Question: Wouldn't it be better to use the cache of the Tenants part here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is. Extrapolates the purpose of the change/ticket though which requires additional/special testing.

@@ -407,7 +407,7 @@ public void selectTenant(final WebContext webContext, String tenantId) {
.causedByUser(account.getUniqueName(), account.getUserAccountData().getLogin().getUsername())
.forUser(account.getUniqueName(), account.getUserAccountData().getLogin().getUsername())
.forTenant(account.getTenant().getIdAsString(),
account.getTenant().fetchValue().getTenantData().getName())
account.getTenant().fetchCachedValue().getTenantData().getName())
Copy link
Member

Choose a reason for hiding this comment

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

see above

@@ -453,7 +453,7 @@ public UserInfo findUserByName(@Nullable WebContext webContext, String user) {
U account = optionalAccount.get();

userAccountCache.put(account.getUniqueName(), account);
tenantsCache.put(account.getTenant().fetchValue().getIdAsString(), account.getTenant().fetchValue());
tenantsCache.put(account.getTenant().fetchCachedValue().getIdAsString(), account.getTenant().fetchCachedValue());
Copy link
Member

Choose a reason for hiding this comment

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

Don't think its a good idea to fill a cache with a cached value

@@ -569,7 +569,8 @@ protected U fetchAccount(@Nonnull String accountId) {
return null;
}
userAccountCache.put(account.getUniqueName(), account);
tenantsCache.put(account.getTenant().fetchValue().getIdAsString(), account.getTenant().fetchValue());
tenantsCache.put(account.getTenant().fetchCachedValue().getIdAsString(),
Copy link
Member

Choose a reason for hiding this comment

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

see above

@idlira idlira closed this Dec 16, 2024
@idlira idlira deleted the ili/SIRI-1059 branch December 16, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💣 BREAKING CHANGE Contains non-backwards compatible changes to public methods or changes the behavior of existing code 🛠️ Maintenance Translations, Code Cleanup, ...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants