-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
organization status changed code changes #5113
organization status changed code changes #5113
Conversation
Signed-off-by: Cy Okeke <[email protected]>
New Issues
Fixed Issues
|
Signed-off-by: Cy Okeke <[email protected]>
…spended-org-status-updated-to-Active
Signed-off-by: Cy Okeke <[email protected]>
Enabled = true | ||
}; | ||
|
||
await _pushNotificationService.SendPayloadToUserAsync(payload.UserId.ToString(), |
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.
I don't know why exactly we expose those methods, but non-selfhosted SignalR does not implement it https://github.com/bitwarden/server/blob/main/src/Core/Services/Implementations/AzureQueuePushNotificationService.cs#L211
In most cases we implement the method for specific notification type in IPushNotificationService and all it's implementations.
…spended-org-status-updated-to-Active
Enabled = organization.Enabled | ||
}; | ||
|
||
await SendPayloadToUserAsync(organization.Id, PushType.SyncOrganizationStatusChanged, message, true); |
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.
- We need to use
SendPayloadToOrganizationAsync
when sending to organization - Last argument needs to be false, since we don't want to exclude current device.
await SendPayloadToUserAsync(organization.Id, PushType.SyncOrganizationStatusChanged, message, true); | |
await SendPayloadToOrganizationAsync(organization.Id, PushType.SyncOrganizationStatusChanged, message, false); |
await PushOrganizationStatusAsync(organization, PushType.SyncOrganizationStatusChanged); | ||
} | ||
|
||
private async Task PushOrganizationStatusAsync(Organization organization, PushType type) | ||
{ |
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.
We don't need the private method. It does not have any benefit.
await PushOrganizationStatusAsync(organization, PushType.SyncOrganizationStatusChanged); | |
} | |
private async Task PushOrganizationStatusAsync(Organization organization, PushType type) | |
{ |
if (organization is not null) | ||
{ |
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.
do we need this check ? I don't think we should expect this to be null.
Enabled = organization.Enabled | ||
}; | ||
|
||
await SendMessageAsync(type, message, true); |
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.
Last argument needs to be false, since we don't want to exclude current device.
await SendMessageAsync(type, message, true); | |
await SendMessageAsync(type, message, false); |
await PushOrganizationStatusAsync(organization, PushType.SyncOrganizationStatusChanged); | ||
} | ||
|
||
private async Task PushOrganizationStatusAsync(Organization organization, PushType type) | ||
{ |
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.
We don't need the private method. It does not have any benefit.
await PushOrganizationStatusAsync(organization, PushType.SyncOrganizationStatusChanged); | |
} | |
private async Task PushOrganizationStatusAsync(Organization organization, PushType type) | |
{ |
|
||
private async Task PushOrganizationStatusAsync(Organization organization, PushType type) | ||
{ | ||
if (organization is not null) |
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.
do we need this check ? I don't think we should expect this to be null.
Enabled = organization.Enabled | ||
}; | ||
|
||
await SendMessageAsync(type, message, true); |
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.
Last argument needs to be false, since we don't want to exclude current device.
await SendMessageAsync(type, message, true); | |
await SendMessageAsync(type, message, false); |
Enabled = organization.Enabled | ||
}; | ||
|
||
await SendPayloadToOrganizationAsync(organization.Id, PushType.SyncOrganizationStatusChanged, message, true); |
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.
Last argument needs to be false, since we don't want to exclude current device.
await SendPayloadToOrganizationAsync(organization.Id, PushType.SyncOrganizationStatusChanged, message, true); | |
await SendPayloadToOrganizationAsync(organization.Id, PushType.SyncOrganizationStatusChanged, message, false); |
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.
LGTM
…spended-org-status-updated-to-Active
…spended-org-status-updated-to-Active
🎟️ Tracking
📔 Objective
📸 Screenshots
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes