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

fit: batch/debounce posts that occur from mass syncs #185

Open
varatep opened this issue Sep 23, 2022 · 1 comment
Open

fit: batch/debounce posts that occur from mass syncs #185

varatep opened this issue Sep 23, 2022 · 1 comment

Comments

@varatep
Copy link

varatep commented Sep 23, 2022

When a user has multiple events that sync all at once generating multiple webhook events, the bot creates posts for every event.

@hellos3b
Copy link
Owner

I've thought about this before, I think to do it without wanting to jump off my balcony is to find a way to find a way to merge multiple "workouts" in one db entry

export type workout = {
readonly __version: 1;
readonly discord_id: string;
readonly activity_id: number;
readonly message_id: string;
readonly activity_name: string;
readonly timestamp: string;
readonly activity_type: string;
readonly exp: Exp.exp;
}

Maybe I can keep the same model and just use duplicate messageId, and then join them when updating the embed. Just not a huge fan because you can't truly tell that a workout can all reference

I think a better option would be expanding the type and making a new one specifically to map post -> workouts

export type workout = {
  readonly activity_id: number;
  readonly activity_name: string;
  readonly timestamp: string;
  readonly activity_type: string;
  readonly exp: Exp.exp
}

export type workout_post = {
  readonly __version: 1;
  readonly discord_id: string;
  readonly message_id: string;
  readonly workouts: workout[];
}

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

No branches or pull requests

2 participants