Revert /v1 endpoint migration#975
Merged
Merged
Conversation
Reverts the API route changes from #969 that added /v1/ prefixes to all backend endpoints, while preserving the 3.4.3 version bump. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReverts the recent /v1 API route prefix migration by restoring all backend and asset URLs to their original paths while keeping the version metadata at 3.4.3. Sequence diagram for message image upload using restored asset endpoint (sequence)sequenceDiagram
actor User
participant Browser
participant XMOJScript
participant APIService
participant AssetService
User->>Browser: Select image to upload
Browser->>XMOJScript: onImageSelected(file)
XMOJScript->>APIService: POST https://api.xmoj-bbs.me/UploadImage
APIService-->>XMOJScript: { Success, Data.ImageID }
XMOJScript->>XMOJScript: Build markdown
Note over XMOJScript: 
XMOJScript->>Browser: Update editor content
User->>Browser: View message with image
Browser->>AssetService: GET https://assets.xmoj-bbs.me/GetImage?ImageID=ImageID
AssetService-->>Browser: Image bytes
Browser-->>User: Render embedded image
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Since both XMOJ.user.js and messages.html now hardcode the same API and asset base URLs without the /v1 prefix, consider centralizing these base URLs in a single configuration/module to avoid divergence the next time an endpoint prefix or domain changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since both XMOJ.user.js and messages.html now hardcode the same API and asset base URLs without the /v1 prefix, consider centralizing these base URLs in a single configuration/module to avoid divergence the next time an endpoint prefix or domain changes.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
What does this PR aim to accomplish?:
Reverts the
/v1API route prefix changes introduced in #969, while keeping the version metadata bump to 3.4.3.How does this PR accomplish the above?:
Removes the
/v1/prefix from all backend API endpoints inXMOJ.user.jsandmessages.html:RequestAPIURL (line 508)API_BASEandASSET_BASEconstants inmessages.htmlVersion metadata (
@version 3.4.3,package.json,Update.json) is intentionally preserved.By submitting this pull request, I confirm the following:
Summary by Sourcery
Revert the
/v1API and asset URL prefix changes to restore compatibility with the original backend routes while keeping the current version metadata intact.Bug Fixes:
Summary by cubic
Reverts the /v1 endpoint migration and restores the original API and asset routes. Removes /v1 from API base, WebSocket notifications path, and image asset URLs in
XMOJ.user.jsandmessages.html; updates version to 3.4.4 (userscript andpackage.json) and adds a 3.4.4 entry inUpdate.json.Written for commit 57467ea. Summary will update on new commits.