fix: address PR #2 review comments - #7
Merged
Conversation
This reverts commit fbba8b0.
Avoids unnecessary network calls during local dev.
Handles a missing trailing slash on screenly_oauth_tokens_url.
- Renames proxyToRealPuzzel to callPuzzel - Drops the synthetic-data fallback for /puzzel routes - Returns 502 on upstream fetch failure instead of crashing - Returns 404 when there's no active Connect session
There was a problem hiding this comment.
Pull request overview
This PR addresses review feedback from PR #2 by tightening access-token retrieval behavior in the Edge App and aligning the mock server toward a “connected/proxy-only” model.
Changes:
fetchAccessTokennow returns a configuredaccess_tokenimmediately (no broker call) and constructs the broker URL robustly whether or not the base URL ends with/.- Tests were updated/expanded to cover the early-return dev token path and URL construction behavior.
- Mock server Puzzel routes now require an active connection and proxy to the real upstream API, with clearer error handling and updated README guidance.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/credentials.ts | Early-return for dev token; safer URL construction for broker endpoint; clearer fallback behavior. |
| src/credentials.test.ts | Adds/updates tests for early-return dev token, request URL building, and fallback behavior. |
| mock-server/src/routes/puzzel.ts | Removes synthetic responses; requires connection and proxies upstream with error handling. |
| mock-server/README.md | Updates docs to reflect proxy-only behavior and connection requirements (but needs a couple of corrections). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Addresses review comments from #2.