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

(BEDS-561) adapt return struct #952

Merged
merged 6 commits into from
Oct 17, 2024
Merged

Conversation

remoterami
Copy link
Contributor

@remoterami remoterami commented Oct 15, 2024

Added the dashboard_name, moved it to the root of the struct and removed all references to dashboard_id as the entire request is dashboard specific already

Copy link

cloudflare-workers-and-pages bot commented Oct 15, 2024

Deploying beaconchain with  Cloudflare Pages  Cloudflare Pages

Latest commit: 61a39b0
Status: ✅  Deploy successful!
Preview URL: https://7da05bfb.beaconchain.pages.dev
Branch Preview URL: https://beds-561-adjust-return-field.beaconchain.pages.dev

View logs

@@ -253,7 +253,7 @@ func (d *DataAccessService) GetNotificationOverview(ctx context.Context, userId

func (d *DataAccessService) GetDashboardNotifications(ctx context.Context, userId uint64, chainIds []uint64, cursor string, colSort t.Sort[enums.NotificationDashboardsColumn], search string, limit uint64) ([]t.NotificationDashboardsTableRow, *t.Paging, error) {
// dev hack; TODO remove
Copy link
Contributor

Choose a reason for hiding this comment

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

I would quickly explain why this was necessary, but the most important part is under which circumstances this can be removed
e.g. during development of Ticket BEDS-565

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved via #956 (requires is_mock_enabled to be set)

validator_offline: number /* uint64 */[]; // validator indices
group_offline: NotificationEventGroup[]; // TODO not filled yet
proposal_missed: IndexBlocks[];
group_offline: string[]; // TODO not filled yet
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not get why this type is broader now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As stated above: because the dashboard name is a static part of the request and doesn't have to be part of each list item (same for group name; also see internal discussion)

proposal_done: IndexBlocks[];
upcoming_proposals: IndexBlocks[];
upcoming_proposals: IndexSlots[];
Copy link
Contributor

Choose a reason for hiding this comment

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

love this thx 💪

@marcel-bitfly
Copy link
Contributor

np: commit messages could be splitted and follow https://www.conventionalcommits.org/en/v1.0.0/#summary

@remoterami remoterami force-pushed the BEDS-561/adjust-return-fields branch from e06bcb7 to 8e1f3e2 Compare October 15, 2024 10:37
Copy link
Contributor

@Eisei24 Eisei24 left a comment

Choose a reason for hiding this comment

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

lgtm, just one question.

Comment on lines +437 to 442
if notificationDetails.GroupName == "" {
notificationDetails.GroupName = t.DefaultGroupName
}

buf := bytes.NewBuffer(result)
gz, err := gzip.NewReader(buf)
if err != nil {
return nil, err
if notificationDetails.DashboardName == "" {
notificationDetails.DashboardName = t.DefaultDashboardName
}
Copy link
Contributor

Choose a reason for hiding this comment

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

question: Why do we set the names to default here and don't leave them as empty strings?
It should also be impossible to create a dashboard or group without a name with at least length 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, it's more of a debug/testing thing - some internal dashboards don't have a name so I thought it wouldn't hurt

@remoterami remoterami merged commit 504c82d into staging Oct 17, 2024
4 checks passed
@LuccaBitfly LuccaBitfly deleted the BEDS-561/adjust-return-fields branch October 17, 2024 11:56
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