Skip to content

(fix) Remove unnecessary IPC request to Platform to get pennid#403

Merged
jonathanmelitski merged 1 commit into
masterfrom
fix/remove-pennid-ipc
Feb 25, 2026
Merged

(fix) Remove unnecessary IPC request to Platform to get pennid#403
jonathanmelitski merged 1 commit into
masterfrom
fix/remove-pennid-ipc

Conversation

@darrentweng
Copy link
Copy Markdown
Contributor

PennID is presumably the id field of the User model (other members like Minghan or Ryan can fact-check me on this), so the Platform call is unnecessary.

Copy link
Copy Markdown
Contributor

@jonathanmelitski jonathanmelitski left a comment

Choose a reason for hiding this comment

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

I'm good with it:

  1. If @ryantanen gives it the okay
  2. If your question in slack (which I also commented on) is answered in the affirmative.

Thanks.

url = f"{PENNGROUPS_URL}{pennid}/groups"
try:
# user.id is the pennid (set by LabsUserBackend at authentication time)
url = f"{PENNGROUPS_URL}{user.id}/groups"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just confirming that the user.id is the numerical id and not the pennkey, though I'm sure you tested

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes it's the numerical ID

Comment thread backend/portal/logic.py
# No bearer token available, re-raise the original IPC error
raise PermissionDenied(f"IPC request failed: {str(ipc_error)}")
"""Returns Platform user information"""
response = authenticated_request(user, "GET", "https://platform.pennlabs.org/accounts/me/")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not sure we should leave a call in here which has known issues, but as long as we keep it top-of-mind, i'm good with pushing with this function still in prod.

I just dont want someone two years from now using that function as if its 100% reliable

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@darrentweng Maybe just add a comment in the code

Copy link
Copy Markdown
Contributor

@minghansun1 minghansun1 left a comment

Choose a reason for hiding this comment

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

lgtm

@jonathanmelitski jonathanmelitski merged commit ff36d2c into master Feb 25, 2026
8 checks passed
@jonathanmelitski jonathanmelitski deleted the fix/remove-pennid-ipc branch February 25, 2026 18:58
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.

3 participants