posthog icon indicating copy to clipboard operation
posthog copied to clipboard

feat: 87% fewer toast messages

Open benjackwhite opened this issue 1 year ago â€ĸ 5 comments

Problem

@annikaschmid 's nifty analysis found we toast - alot! We do this in ways that isn't particularly helpful, primarily when:

  1. You aren't connected to the internet (often happening when you close your laptop or some other thing that loses connection)
  2. You are logged out for one reason or another and so get 401 errors.

Changes

2024-02-16 16 39 25

  • Only show a toast if we have a proper error message - if we think it is offline, show a top level banner instead
  • If we see a 401, we call the @me endpoint to see if we are for sure logged out and then actually do the logout (redirecting to login)
  • Also refactors the api a bit to have some better standard fetch handling

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

How did you test this code?

benjackwhite avatar Feb 16 '24 15:02 benjackwhite

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Feb 16 '24 15:02 posthog-bot

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Feb 16 '24 15:02 posthog-bot

Size Change: +770 B (0%)

Total Size: 813 kB

â„šī¸ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 813 kB +770 B (0%)

compressed-size-action

github-actions[bot] avatar Feb 16 '24 15:02 github-actions[bot]

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Feb 16 '24 16:02 posthog-bot

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Feb 16 '24 17:02 posthog-bot

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Feb 19 '24 08:02 posthog-bot

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Feb 20 '24 10:02 posthog-bot

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Feb 20 '24 13:02 posthog-bot

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Feb 20 '24 13:02 posthog-bot

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Feb 20 '24 13:02 posthog-bot

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Mar 06 '24 17:03 posthog-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 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Mar 06 '24 17:03 posthog-bot

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Mar 06 '24 17:03 posthog-bot

📸 UI snapshots have been updated

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

  • chromium: 0 added, 1 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 Mar 06 '24 17:03 posthog-bot

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Mar 06 '24 18:03 posthog-bot

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Mar 06 '24 18:03 posthog-bot

📸 UI snapshots have been updated

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Mar 06 '24 18:03 posthog-bot

📸 UI snapshots have been updated

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

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

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Mar 06 '24 18:03 posthog-bot