Merge main into ledgertests#452
Conversation
Update SurrealDB to v3.0.1
…urned with incorrect status codes
…e title to reflect this
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.9.3 to 6.0.2. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v5.9.3...v6.0.2) --- updated-dependencies: - dependency-name: typescript dependency-version: 6.0.2 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…/Site/typescript-6.0.2 Bump typescript from 5.9.3 to 6.0.2 in /Site
…ROVED MERCURY CSS. IMPROVED MERCURY CSS. IMPROVED MERCURY CSS. IMPROVED MERCURY CSS. IMPROVED MERCURY CSS.
…CSS. IMPROVED MERCURY CSS. IMPROVED MERCURY CSS. IMPROVED MERCURY CSS. IMPROVED MERCURY CSS. IMPROVED MERCURY CSS." This reverts commit ed8db7c.
Bumps [@types/nodemailer](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/nodemailer) from 7.0.11 to 8.0.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/nodemailer) --- updated-dependencies: - dependency-name: "@types/nodemailer" dependency-version: 8.0.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…/Site/types/nodemailer-8.0.0 Bump @types/nodemailer from 7.0.11 to 8.0.0 in /Site
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Deployment error perhaps due to the (not specifying which) GitHub Actions outage |
There was a problem hiding this comment.
Pull request overview
This PR merges main into ledgertests, bringing in a broad set of updates across the Site service, SurrealDB schema/queries, configuration structure, and documentation (notably around SurrealDB v3, client TLS constraints, and suite services like Orbiter/Launcher).
Changes:
- Restructures Mercury Core configuration (adds
DomainInsecure, groupsDatabase/Economy/Orbiter), and updates many HTTP URLs accordingly. - Migrates SurrealDB usage and schema/SurrealQL patterns (computed fields, defaults,
type::record, new helper functions likefn::currentContent/fn::search). - Expands docs and updates dependencies / tooling (Site + Docs packages, Database image).
Reviewed changes
Copilot reviewed 120 out of 124 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| mercury.core.ts | Config shape restructure + defaults |
| Site/src/routes/notifications.surql | SurrealQL scoping update |
| Site/src/routes/api/render/update/[taskId=taskid]/+server.ts | Surreal client API update usage |
| Site/src/routes/api/avatar/[username]/+server.ts | Add bounded wait timeout logic |
| Site/src/routes/(rbxclient)/game/tools/thumbnailasset/+server.ts | Surreal update API usage |
| Site/src/routes/(rbxclient)/game/join/join.surql | SurrealQL scoping updates |
| Site/src/routes/(rbxclient)/game/join/+server.ts | Dedicated join host/port logic updates |
| Site/src/routes/(rbxclient)/game/host/+server.ts | Switch to DomainInsecure URLs |
| Site/src/routes/(rbxclient)/game/gameserver/+server.ts | Switch to DomainInsecure base URL |
| Site/src/routes/(rbxclient)/game/[id=asset]/serve/+server.ts | Switch to DomainInsecure URLs |
| Site/src/routes/(rbxclient)/asset/characterfetch/[username]/user.surql | Wearing query rewrite |
| Site/src/routes/(rbxclient)/asset/characterfetch/[username]/+server.ts | Switch to DomainInsecure URLs |
| Site/src/routes/(rbxclient)/asset/+server.ts | XML detection helper + URL substitution |
| Site/src/routes/(plain)/register/createUser.surql | Remove explicit admin field |
| Site/src/routes/(plain)/register/+page.server.ts | Stop passing admin param |
| Site/src/routes/(plain)/recover/code/+page.server.ts | Surreal update API usage |
| Site/src/routes/(plain)/recover/+page.server.ts | Await email sending |
| Site/src/routes/(plain)/+page.server.ts | Use version().version |
| Site/src/routes/(main)/user/[username]/user.surql | Use fn::currentContent + comment listing |
| Site/src/routes/(main)/user/[username]/+page.svelte | UI shows “Latest comments” |
| Site/src/routes/(main)/user/[username]/+page.server.ts | Update types for new query shape |
| Site/src/routes/(main)/settings/updateProfile.surql | fn::currentContent description compare |
| Site/src/routes/(main)/settings/+page.server.ts | Surreal update API usage |
| Site/src/routes/(main)/search/searchUsers.surql | Switch to fn::search |
| Site/src/routes/(main)/search/searchPlaces.surql | Switch to fn::search + fn::filterGames |
| Site/src/routes/(main)/search/searchGroups.surql | Switch to fn::search |
| Site/src/routes/(main)/search/searchAssets.surql | Switch to fn::search + type ordering |
| Site/src/routes/(main)/place/[id=asset]/placeId.surql | SurrealQL scoping update |
| Site/src/routes/(main)/place/[id=asset]/[name]/settings/updateSettings.surql | fn::currentContent compare |
| Site/src/routes/(main)/place/[id=asset]/[name]/settings/settings.surql | fn::currentContent + scoping update |
| Site/src/routes/(main)/place/[id=asset]/[name]/settings/serverTicket.surql | rand::guid → rand::id |
| Site/src/routes/(main)/place/[id=asset]/[name]/settings/privateTicket.surql | rand::guid → rand::id |
| Site/src/routes/(main)/place/[id=asset]/[name]/settings/View.svelte | Description type change (string) |
| Site/src/routes/(main)/place/[id=asset]/[name]/settings/+page.server.ts | Surreal update API usage + types |
| Site/src/routes/(main)/place/[id=asset]/[name]/place.surql | fn::currentContent + scoping update |
| Site/src/routes/(main)/place/[id=asset]/[name]/invalidatePlaying.surql | Rely on relation defaults |
| Site/src/routes/(main)/place/[id=asset]/[name]/findPlace.surql | SurrealQL scoping update |
| Site/src/routes/(main)/place/[id=asset]/[name]/+page.svelte | Description type change + close button tweak |
| Site/src/routes/(main)/place/[id=asset]/[name]/+page.server.ts | Orbiter URL config restructure |
| Site/src/routes/(main)/home/home.surql | fn::currentContent + scoping update |
| Site/src/routes/(main)/groups/[group=strid]/members/members.surql | SurrealQL scoping update |
| Site/src/routes/(main)/groups/[group=strid]/group.surql | SurrealQL scoping update |
| Site/src/routes/(main)/games/games.surql | SurrealQL scoping update |
| Site/src/routes/(main)/games/create/create.surql | Remove explicit updated entry |
| Site/src/routes/(main)/forum/forum.surql | Use fn::currentContent |
| Site/src/routes/(main)/forum/[category]/category.surql | Use fn::currentContent |
| Site/src/routes/(main)/develop/create/createAsset.surql | Add visibility + remove updated |
| Site/src/routes/(main)/develop/create/assetTypes.ts | Add “Face” type |
| Site/src/routes/(main)/develop/create/+page.svelte | Price display conditional on permission |
| Site/src/routes/(main)/develop/create/+page.server.ts | Face upload logic + visibility + ratelimit gating |
| Site/src/routes/(main)/develop/+page.svelte | Add “Faces” tab |
| Site/src/routes/(main)/comment/[comment=strid]/removeComment.surql | Remove explicit updated |
| Site/src/routes/(main)/comment/[comment=strid]/comment.remote.ts | Add asset slug encoding in info |
| Site/src/routes/(main)/comment/[comment=strid]/+page.svelte | Derived query + breadcrumb fixes |
| Site/src/routes/(main)/character/+page.server.ts | Await Surreal update for body colours |
| Site/src/routes/(main)/catalog/[id=asset]/[name]/settings/updateAsset.surql | fn::currentContent compare |
| Site/src/routes/(main)/catalog/[id=asset]/[name]/settings/assetCheck.surql | Simplify creator check |
| Site/src/routes/(main)/catalog/[id=asset]/[name]/settings/asset.surql | fn::currentContent + scoping update |
| Site/src/routes/(main)/catalog/[id=asset]/[name]/settings/+page.svelte | Description type change (string) |
| Site/src/routes/(main)/catalog/[id=asset]/[name]/settings/+page.server.ts | Types updated + remove debug logging |
| Site/src/routes/(main)/catalog/[id=asset]/[name]/icon/asset.surql | SurrealQL scoping update |
| Site/src/routes/(main)/catalog/[id=asset]/[name]/icon/+server.ts | Re-render face thumbnails + thumbnail API update |
| Site/src/routes/(main)/catalog/[id=asset]/[name]/buy.surql | SurrealQL scoping update |
| Site/src/routes/(main)/catalog/[id=asset]/[name]/asset.surql | fn::currentContent + scoping update |
| Site/src/routes/(main)/catalog/[id=asset]/[name]/+page.svelte | Pass likeForm into Comment component |
| Site/src/routes/(main)/catalog/[id=asset]/[name]/+page.server.ts | Description type change (string) |
| Site/src/routes/(main)/catalog/[id=asset]/+page.server.ts | Redirect uses encoded slug |
| Site/src/routes/(main)/admin/reports/reports.surql | SurrealQL scoping update |
| Site/src/routes/(main)/admin/regkeys/create.surql | type::record + rand::id |
| Site/src/routes/(main)/admin/regkeys/+page.server.ts | Use AlreadyExistsError + errMessage |
| Site/src/routes/(main)/admin/moderation/assocreport.surql | SurrealQL scoping update |
| Site/src/routes/(main)/admin/create/create.surql | Remove explicit updated entry |
| Site/src/routes/(main)/admin/create/+page.server.ts | Validate face XML + reuse buffer |
| Site/src/routes/(main)/admin/banners/+page.server.ts | Table constants + errMessage + update API |
| Site/src/routes/(main)/admin/asset/asset.surql | SurrealQL scoping update |
| Site/src/routes/(main)/admin/accounts/updatePassword.surql | Case-insensitive update + boolean result |
| Site/src/routes/(main)/admin/accounts/+page.server.ts | Improved error messaging + boolean result |
| Site/src/routes/(legal)/report/+page.server.ts | Use errMessage for invalid user |
| Site/src/lib/server/xmlAsset.ts | Minor asset type logic tweak |
| Site/src/lib/server/xml.ts | New XML detection helper |
| Site/src/lib/server/validate.ts | Add errMessage helper |
| Site/src/lib/server/surreal.ts | Surreal v3 connection/schema init updates + table constants |
| Site/src/lib/server/orbiter.ts | Orbiter config restructure |
| Site/src/lib/server/init.surql | Major schema overhaul + new functions |
| Site/src/lib/server/imageAsset.ts | thumbnail signature now takes ArrayBuffer |
| Site/src/lib/server/idToPort.ts | Add proxy offset + adjust modulo |
| Site/src/lib/server/getSessionAndUser.surql | fn::currentContent + session expiry handling tweak |
| Site/src/lib/server/email.ts | Add SMTP secure config |
| Site/src/lib/server/createComment.surql | Remove explicit updated entry |
| Site/src/lib/server/config.ts | Config schema restructure |
| Site/src/lib/comment.ts | Stronger typing for info union |
| Site/src/components/forms/Select.svelte | Readonly options + simplified selected logic |
| Site/src/components/Comment.svelte | Remove stray debug output line |
| Site/src/app.d.ts | lastOnline type to Date |
| Site/package.json | Dependency updates (SurrealDB v2 client, TS 6, SvelteKit, etc.) |
| Site/Caddyfile | Add explicit insecure HTTP host binding |
| Docs/src/content/docs/services/site.md | Update startup docs + Surreal version |
| Docs/src/content/docs/services/rcc.mdoc | Clarify proxy env example |
| Docs/src/content/docs/services/orbiter.mdoc | Add Orbiter start instructions + env example |
| Docs/src/content/docs/services/launcher.md | New Launcher service docs |
| Docs/src/content/docs/services/database.md | Update Surreal v3 logs + guidance |
| Docs/src/content/docs/install/surrealdb.md | Update to SurrealDB v3 |
| Docs/src/content/docs/install/index.md | Expand install scope + add .NET |
| Docs/src/content/docs/install/go.md | Update Go version guidance |
| Docs/src/content/docs/install/dotnet.md | New .NET install page |
| Docs/src/content/docs/install/docker.md | Minor wording tweak |
| Docs/src/content/docs/install/caddy.md | Update Caddy version |
| Docs/src/content/docs/install/bun.md | Update Bun version |
| Docs/src/content/docs/history.md | Correct historical details/links |
| Docs/src/content/docs/guides/rccsetup.mdoc | New RCC setup guide |
| Docs/src/content/docs/guides/prodsetup.mdoc | Formatting cleanup |
| Docs/src/content/docs/guides/launchersetup.mdoc | New Launcher setup guide |
| Docs/src/content/docs/guides/devsetup.mdoc | Expand common issues section |
| Docs/src/content/docs/guides/coresetup.mdoc | Update wording re: dedicated servers |
| Docs/src/content/docs/guides/config.mdoc | New config guide |
| Docs/src/content/docs/design/mercury3.md | New Mercury 3 vs Core overview |
| Docs/src/content/docs/design/client-tls.md | New TLS design explanation |
| Docs/src/content/docs/architecture/stack.md | Update stack overview |
| Docs/src/content/docs/architecture/launchers.md | New platform-types overview |
| Docs/package.json | Astro/starlight updates + bun x scripts |
| Database/Dockerfile | SurrealDB image v3 |
| Assets/schema.ts | Config type updated for new config shape |
Comments suppressed due to low confidence (1)
Site/src/lib/server/getSessionAndUser.surql:30
- When the session is expired you
DELETE $sbut$sremains truthy, so the final object still returnssession: record::id($s.id)even though the record was deleted. This can cause callers to treat an expired session as still present. Set$s = NONEafter deleting (or restructure the logic sosessionis derived from an existence check after the delete).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # todo: check ping is correct (server hasn't actually pung) | ||
| RELATE $user->playing->$place RETURN VALUE record::id(id); |
There was a problem hiding this comment.
Typo in comment: pung → pinged (and the sentence reads a bit unclear). Since this is user-facing documentation for maintainers, it’s worth fixing.
| message( | ||
| form, | ||
| "Key created successfully! Check the Keys tab for your new key." | ||
| ) |
There was a problem hiding this comment.
actions.create calls message(...) but doesn’t return it, so the action result becomes undefined and the superforms message won’t be delivered to the client. Return the result of message(...) (or errMessage(...)) from the action.
| await Promise.race([ | ||
| new Promise<void>(resolve => { | ||
| try { | ||
| const watcher = fs.watch(path, () => { | ||
| watcher.close() | ||
| resolve() | ||
| }) | ||
| } catch { | ||
| resolve() | ||
| }) | ||
| } catch { | ||
| resolve() | ||
| } | ||
| }) | ||
| } | ||
| }), | ||
| // ...but don't wait forever | ||
| new Promise(resolve => setTimeout(resolve, timeout * 1000)), | ||
| ]) |
There was a problem hiding this comment.
Promise.race can resolve via the timeout while the fs.watch watcher remains open (never closed), which can leak file descriptors and keep watching indefinitely. Ensure the watcher is always cleaned up (e.g., keep a reference and close() it when the timeout wins / in a finally, and clear the timeout when the watch wins).
| function serverInfo(place: Session["place"]): ServerAddress { | ||
| if (!serverDedicated(place.dedicated)) return place | ||
|
|
||
| const url = new URL(config.Orbiter.PublicURL) | ||
| return { | ||
| serverHostname: url.hostname, // no scheme, the address doesn't usually have a path anyway | ||
| serverPort: idToPort(place.id) + proxyOffset, // select the proxy port rather than the port of the server itself | ||
| } |
There was a problem hiding this comment.
serverInfo() returns place directly for non-dedicated hosting, but place comes from SurrealQL with serverAddress/serverPort fields (see join.surql) — it does not have serverHostname. This makes serverHostname undefined for self-hosted joins. Either alias serverAddress AS serverHostname in the query, or map serverAddress -> serverHostname inside serverInfo, or keep the original serverAddress naming consistently.
| bodyColours, | ||
| (SELECT record::id(id) AS id | ||
| FROM ->wearing->asset).id AS wearing | ||
| SELECT VALUE record::id(id) FROM $this->wearing->asset AS wearing | ||
| FROM user WHERE username = $username; |
There was a problem hiding this comment.
This SurrealQL looks syntactically invalid: SELECT field lists can’t contain a bare SELECT VALUE ... FROM ... statement. Wrap it as a subquery expression and alias it (e.g. (SELECT VALUE record::id(id) FROM $this->wearing->asset) AS wearing) to return the array of wearing asset ids.
| import { type } from "arktype" | ||
| import { ThrownError } from "surrealdb" | ||
| import { authorise } from "$lib/server/auth" |
There was a problem hiding this comment.
ThrownError is imported but never used. Remove the unused import to avoid TypeScript/biome no-unused-vars failures and keep the file clean.
| new Uint8Array(buf.slice(0, 7)).every( | ||
| (b, i) => b === xmlStart.charCodeAt(i) // we ont need unicote here but who care | ||
| ) |
There was a problem hiding this comment.
Typo in the inline comment (we ont need unicote here but who care) makes this helper harder to read/maintain. Please fix the spelling/grammar (and consider using xmlStart.length instead of the magic number 7).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Onya co-pylote |
No description provided.