Skip to content

ENG-1968 Pre-check groups a node is already shared to in the Publish tab - #1353

Open
sid597 wants to merge 1 commit into
mainfrom
eng-1968-precheck-already-shared-groups
Open

ENG-1968 Pre-check groups a node is already shared to in the Publish tab#1353
sid597 wants to merge 1 commit into
mainfrom
eng-1968-precheck-already-shared-groups

Conversation

@sid597

@sid597 sid597 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

When the Publish tab loads groups, it now also fetches the already-published node ids per group and pre-checks each group that already contains every publishable node in the current selection (the many-nodes case: a group is only pre-checked when all selected nodes are shared to it).

Unchecking a pre-checked group does not unshare — publish remains additive; re-publishing an already-shared selection is a no-op upsert. Also exports the existing getAllPublishedIdsByGroup helper so the dialog can reuse it.

@linear-code

linear-code Bot commented Aug 26, 2026

Copy link
Copy Markdown

ENG-1968

@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
discourse-graph Skipped Skipped Aug 26, 2026 10:30am

Request Review

@supabase

supabase Bot commented Aug 26, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6ef082961

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

context.spaceId,
groups.map((g) => g.id),
);
setSelectedGroupIds(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Refresh prechecked groups when the dialog reopens

When the persistent Export component in ResultsView.tsx is closed and later reopened after its query results change, groupsLoaded is still true, so the effect returns before recalculating this selection. The group IDs automatically selected here therefore remain associated with the previous nodes; publishing the new results can unintentionally share them with those stale groups. Reset the loading/selection state on close or recompute the prechecked groups whenever publishableNodes changes.

Useful? React with 👍 / 👎.

Comment on lines +827 to +831
const publishedIdsByGroup = await getAllPublishedIdsByGroup(
client,
context.spaceId,
groups.map((g) => g.id),
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Limit or paginate the published-resource lookup

For a space/group combination with more than 1,000 ResourceAccess entries, this call receives only the first page because packages/database/supabase/config.toml sets max_rows = 1000, while getAllPublishedIdsByGroup neither paginates nor filters by the nodes being checked. An already-published node omitted from that page is therefore shown as unchecked. Query only the relevant node UIDs for this precheck or paginate until all matching rows have been read.

Useful? React with 👍 / 👎.

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

Successfully merging this pull request may close these issues.

1 participant