Repository navigation
fix: forget cached profile previews when logging out or deleting the account #1249
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
Open
sulimanbenhalim
wants to merge
5
commits into
dev-null-sh:production
Choose a base branch
from
sulimanbenhalim:fix/clear-user-previews-on-logout
base: production
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+185
−8
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3afbf75
fix: forget cached profile previews when logging out or deleting the …
sulimanbenhalim 46b89f1
fix: drop profile previews that finish loading after the cache was cl…
sulimanbenhalim 7fd648b
fix: remount the page after logging out so an open profile preview cl…
sulimanbenhalim df18e3d
fix: stop a preview follow that lands after logging out from refillin…
sulimanbenhalim 4a18865
fix: stop a preview from showing a guest the follow of the account th…
sulimanbenhalim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /// <reference types="node" /> | ||
| import assert from 'node:assert/strict'; | ||
| import * as React from 'react'; | ||
| import type { ReactElement } from 'react'; | ||
| import { test, vi } from 'vite-plus/test'; | ||
| import type { User } from '../../resources/js/types'; | ||
|
|
||
| vi.doMock('react', () => ({ | ||
| ...React, | ||
| useCallback: (callback: unknown) => callback, | ||
| })); | ||
| vi.doMock('@inertiajs/react', async () => ({ | ||
| ...(await vi.importActual('@inertiajs/react')), | ||
| usePage: () => ({ props: { auth: { isAdmin: false }, repository: '' } }), | ||
| })); | ||
|
|
||
| const { UserMenuContent } = | ||
| await import('../../resources/js/components/user-menu-content'); | ||
|
|
||
| test('logging out remounts the page instead of keeping what the signed in account had open', () => { | ||
| const items = React.Children.toArray( | ||
| UserMenuContent({ user: { id: 'author', handle: 'author' } as User }) | ||
| .props.children, | ||
| ); | ||
| const logout = ( | ||
| items.at(-1) as ReactElement<{ | ||
| children: ReactElement<{ | ||
| preserveState?: boolean; | ||
| 'data-test': string; | ||
| }>; | ||
| }> | ||
| ).props.children; | ||
|
|
||
| assert.equal(logout.props['data-test'], 'logout-button'); | ||
| assert.equal(logout.props.preserveState, false); | ||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.