-
Notifications
You must be signed in to change notification settings - Fork 6
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
Conversation
Fixes: SIRI-1039
Fixes: SIRI-1039
There was a problem hiding this 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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
Description
Marking as BREAKING since this applies a breaking change from sirius-biz.
Additional Notes
Checklist