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-469) DA: notifications dashboard table #893

Merged
merged 19 commits into from
Oct 14, 2024

Conversation

remoterami
Copy link
Contributor

No description provided.

Copy link

cloudflare-workers-and-pages bot commented Sep 27, 2024

Deploying beaconchain with  Cloudflare Pages  Cloudflare Pages

Latest commit: b2b8eef
Status: ✅  Deploy successful!
Preview URL: https://ebc528ee.beaconchain.pages.dev
Branch Preview URL: https://beds-469-notifications-dashb.beaconchain.pages.dev

View logs

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.

Looks good but please have a look at the cursor issue.

backend/pkg/api/enums/notifications_enums.go Outdated Show resolved Hide resolved
Comment on lines 138 to 141
Epoch uint64
ChainId uint64
DashboardName string
GroupName string
Copy link
Contributor

Choose a reason for hiding this comment

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

issue: This does not uniquely identify a row since dashboards and their groups can have the same name multiple times.
You would need the DashboardId & GroupId instead.

Copy link
Contributor Author

@remoterami remoterami Oct 8, 2024

Choose a reason for hiding this comment

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

Correct I missed that, thanks

Edit:
Thinking about it.. this might be a bit tricky. If we want the user to sort by dashboard/group name, we need to have both I think. If name is replaced by id it's possible to return duplicated rows.

I'll push that for now, can think of some examples and/or we discuss this in detail.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, in the cursor I would have all 4 of them for an easier query.

frontend/types/api/notifications.ts Outdated Show resolved Hide resolved
backend/pkg/api/data_access/general.go Outdated Show resolved Hide resolved
backend/pkg/api/data_access/general.go Show resolved Hide resolved
backend/pkg/api/data_access/notifications.go Show resolved Hide resolved
backend/pkg/api/data_access/notifications.go Outdated Show resolved Hide resolved
@remoterami remoterami force-pushed the BEDS-469/notifications-dashboard-table branch from 1b234eb to 0b1331d Compare October 8, 2024 10:41
Copy link
Contributor

@peterbitfly peterbitfly left a comment

Choose a reason for hiding this comment

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

waiting for green light regarding the changes in the api package, if thats ok the pr can be merged

@@ -687,6 +687,9 @@ func (v *validationError) checkNetworkParameter(param string) uint64 {
}

func (v *validationError) checkNetworksParameter(param string) []uint64 {
if param == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

@LuccaBitfly is this change ok with you?

GroupName string `json:"group_name"`
EntityCount uint64 `json:"entity_count"`
EventTypes []string `json:"event_types" tstype:"('validator_online' | 'validator_offline' | 'group_online' | 'group_offline' | 'attestation_missed' | 'proposal_success' | 'proposal_missed' | 'proposal_upcoming' | 'max_collateral' | 'min_collateral' | 'sync' | 'withdrawal' | 'validator_got_slashed' | 'validator_has_slashed' | 'incoming_tx' | 'outgoing_tx' | 'transfer_erc20' | 'transfer_erc721' | 'transfer_erc1155')[]" faker:"slice_len=2, oneof: validator_online, validator_offline, group_online, group_offline, attestation_missed, proposal_success, proposal_missed, proposal_upcoming, max_collateral, min_collateral, sync, withdrawal, validator_got_slashed, validator_has_slashed, incoming_tx, outgoing_tx, transfer_erc20, transfer_erc721, transfer_erc1155"`
IsAccountDashboard bool `db:"is_account_dashboard" json:"is_account_dashboard"` // if false it's a validator dashboard
Copy link
Contributor

Choose a reason for hiding this comment

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

@LuccaBitfly is this change ok with you?

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.

utACK, please wait for the confirmation from other reviewers before merging.
I can't really tell what the linter issue here is.

@@ -146,23 +155,12 @@ func (d *DataAccessService) GetDashboardNotifications(ctx context.Context, userI
defaultColumns := []t.SortColumn{
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: Since the default column entries only require those that uniquely identify a row you don't need to add the dashboard and group names to it.
However if you change it this way you would need the offset if again.

Both ways work for me but consider that the query could be faster with less WHERE/ORDER BY.

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, while the ids would be enough it's kind of a workaround that allows unique sorting by name at the cost of increased overhead.

I'd change it if the query becomes an issue

@remoterami remoterami merged commit 25b14ef into staging Oct 14, 2024
2 checks passed
@sasha-bitfly sasha-bitfly deleted the BEDS-469/notifications-dashboard-table branch January 13, 2025 08:33
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