Skip to content

Upgrade merge - #94

Merged
heshanlk merged 4 commits into
heidisoft:mainfrom
brightbeanxyz:main
Sep 13, 2026
Merged

heshanlk merged 4 commits into
heidisoft:mainfrom
brightbeanxyz:main

Conversation

@heshanlk

Copy link
Copy Markdown
Member

What does this PR do?

Why?

How to test

Checklist

  • Tests pass (pytest)
  • Lint passes (ruff check . and ruff format --check .)
  • Documentation updated (if applicable)

JanSchm and others added 4 commits September 10, 2026 21:57
…ing revoke

Meta drops permissions it has not approved, or that the user declined,
without failing the grant. The connection then reports Connected and only
breaks later — at publish or insights time — with an opaque platform
error. That is how Instagram publishing stayed broken until Meta's app
review said so, rather than the app saying so at connect time.

Read the grant back after connecting and record what is missing. The
readback inspects the token via /debug_token rather than /me/permissions:
these accounts hold a Page token, so /me resolves to the Page, which has
no permissions edge. A platform that cannot be asked reports unknown, never
an empty set — that would flag every scope as missing. The comparison
applies the same analytics-scope flag OAuth used, so a scope deliberately
omitted when a platform's analytics is off is not reported as absent.

Ask again for scopes the user declined. Without auth_type=rerequest Meta
skips the dialog entirely on a reconnect, so a declined scope could never
be requested a second time. It does not force the full permission list for
someone who granted everything — only removing the app does that.

Stop pretending disconnect revokes anything. The only endpoint that would,
DELETE /me/permissions, revokes this app for the whole person: one
workspace disconnecting one Page would sever every other Page and
Instagram account they connected anywhere. It never worked here anyway,
being called with a Page token. It is now an explicit no-op, and the
disconnect dialog says where to actually revoke.

Underneath that sat a real defect: select_account and the connection-link
flow had each written their own page-token selection and diverged.
Onboarding fell back to the *user* token for a Facebook Page, which
publishes under the wrong identity and made that account eligible for the
revoke above. Both flows now share resolve_page_account_token, and a Page
we have to skip is reported to the client instead of leaving them on a
success page for an account that was never connected.

Also fixes a permanently-red test: test_fetch_post_comments... pinned
2026-08-07, which had drifted past FACEBOOK_FEED_WINDOW_DAYS so the window
floor landed after it and the assertion inverted. Both dates are now
relative to now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ility

fix(social-accounts): make a partial Meta grant visible, and stop faking revoke
Django's {# #} syntax is single-line only: the lexer matches {#.*?#}
without DOTALL, so a comment that wraps onto a second line is never
recognised as one and falls through as plain text. Two comments had
wrapped, and were printing verbatim in the UI - the disconnect
rationale inside the account card's confirmation popover, and the
first-comment note in every row of the sent-posts table.

Move both to {% comment %} blocks, which do span lines.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ment-acc369

fix(templates): stop multi-line {# #} comments rendering to the page
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@heshanlk
heshanlk merged commit f7603cf into heidisoft:main Sep 13, 2026
4 checks passed
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.

2 participants