-
Notifications
You must be signed in to change notification settings - Fork 6
feat(admin): add durably for resumable background translation jobs #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
bf75866
feat(admin): add durably for resumable background translation jobs
coji d2e76ab
fix(ProjectDetail): adjust className order for translation job status…
coji 45fb37c
fix(admin): use splat route for durably API endpoint
coji 00ff5db
fix(admin): use useJob hook directly from durably-react/client
coji 8b39f20
feat(admin): add job history UI and error details
coji c082270
refactor(admin): improve code quality based on review
coji c1baafe
fix(admin): address CodeRabbit review feedback
coji 0a94080
refactor(admin): streamline package.json and pnpm workspace for bette…
coji a88275e
feat(admin): upgrade durably to v0.8.0 with autoResume/followLatest
coji File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { durablyHandler } from '~/services/durably.server' | ||
| import type { Route } from './+types/api.durably.$' | ||
|
|
||
| export async function loader({ request }: Route.LoaderArgs) { | ||
| return await durablyHandler.handle(request, '/api/durably') | ||
| } | ||
|
|
||
| export async function action({ request }: Route.ActionArgs) { | ||
| return await durablyHandler.handle(request, '/api/durably') | ||
| } | ||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 142
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 1261
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 89
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 1039
🏁 Script executed:
# Read the durably.server.ts file to understand the handler implementation cat -n apps/admin/app/services/durably.server.tsRepository: coji/remix-docs-ja
Length of output: 4116
🏁 Script executed:
# Look for layout files in admin app that might enforce authentication cat -n apps/admin/app/routes/_app+/_layout.tsxRepository: coji/remix-docs-ja
Length of output: 744
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 101
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 125
🏁 Script executed:
# Check the admin app root level for any layout or entry files cat -n apps/admin/app/entry.server.tsxRepository: coji/remix-docs-ja
Length of output: 125
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 44
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 100
🏁 Script executed:
# Check the root.tsx for auth protection or middleware cat -n apps/admin/app/root.tsxRepository: coji/remix-docs-ja
Length of output: 2148
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 44
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 1261
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 1346
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 1987
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 1416
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 421
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 563
🏁 Script executed:
# Check the _app+ layout more carefully and look for any middleware or data loading cat -n apps/admin/app/routes/_app+/_layout.tsxRepository: coji/remix-docs-ja
Length of output: 744
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 46
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 139
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 894
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 155
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 139
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 147
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 1008
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 3303
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 1828
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 301
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 677
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 100
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 126
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 150
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 44
🏁 Script executed:
# Check if there's a server configuration or middleware setup in react-router config cat -n apps/admin/react-router.config.tsRepository: coji/remix-docs-ja
Length of output: 201
🏁 Script executed:
# Look for any server middleware or guards in vite config cat -n apps/admin/vite.config.tsRepository: coji/remix-docs-ja
Length of output: 851
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 590
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 1763
🏁 Script executed:
Repository: coji/remix-docs-ja
Length of output: 44
Add authentication checks to
/api/durably/*endpoint to prevent unauthorized job operations.The route is accessible without authentication. Any caller can trigger or query translation jobs unless protection is enforced at the handler or request level. This is a real risk if the admin app is exposed beyond internal use.
The
basePathparameter is correct for splat routing.Optional refactoring (eliminate code duplication)
import { durablyHandler } from '~/services/durably.server' import type { Route } from './+types/api.durably.$' +const handle = (request: Request) => durablyHandler.handle(request, '/api/durably') + export async function loader({ request }: Route.LoaderArgs) { - return await durablyHandler.handle(request, '/api/durably') + return handle(request) } export async function action({ request }: Route.ActionArgs) { - return await durablyHandler.handle(request, '/api/durably') + return handle(request) }📝 Committable suggestion