posthog icon indicating copy to clipboard operation
posthog copied to clipboard

fix: add debounce to infinite list

Open timgl opened this issue 1 year ago â€ĸ 6 comments

Problem

There's no debounce so we're firing off a bunch of requests

Changes

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

How did you test this code?

timgl avatar May 07 '24 17:05 timgl

Size Change: 0 B

Total Size: 1.05 MB

â„šī¸ View Unchanged
Filename Size
frontend/dist/toolbar.js 1.05 MB

compressed-size-action

github-actions[bot] avatar May 07 '24 18:05 github-actions[bot]

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar May 07 '24 18:05 posthog-bot

Hmm, we do already have a breakpoint in loadRemoteItems itself – so we shouldn't need one before calling that. Wonder what am I missing.

Twixes avatar May 07 '24 18:05 Twixes

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar May 07 '24 18:05 posthog-bot

I was under the impression I added appropriate debounce when I was at it. Can have a look later.

webjunkie avatar May 07 '24 18:05 webjunkie

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

posthog-bot avatar May 15 '24 07:05 posthog-bot

@timgl Where did you see this change fixing an issue?

I tested this on the breakdown popup, which definitely hits this code path, and it does seem like it's already properly debounced without this addition.

aspicer avatar May 21 '24 15:05 aspicer

Yup, also checked, and the await breakpoint() in loadRemoteItems works for me too – so this doesn't seem needed.

Twixes avatar May 21 '24 15:05 Twixes