Skip to content

Switching share-link permission can copy a stale 'view' link #48

Description

@Alimedhat000

Problem

Changing ShareModeSelect triggers a refetch whose closure still holds the previous default 'view' (client/src/hooks/useShareLink.ts:15), racing the effect refetch (share-button.tsx:55-59). The displayed/copied URL can be a view token while the select shows Edit.

Fix

Derive the fetch from the current selection state synchronously (or cache links per-permission) so copied URLs always match the selected mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority/mediumMedium priority

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions