[studio] rate limit stub

This commit is contained in:
Devin Zuczek
2026-10-08 14:27:54 -04:00
parent 7ec295ef33
commit 6b8c908771
2 changed files with 23 additions and 0 deletions
+13
View File
@@ -178,6 +178,19 @@ const app = new Hono<App>()
// Local Windows + Android bundles from the editor button under Upload.
.post('/cloud-builds/from-editor', (c) => postLocalCloudBuild(c))
// Studio asks how often it may request cloud builds. Stubbed: this server
// never queues a real cloud build (every build is local, see from-editor),
// so the numbers are permissive placeholders. The field names are an
// ASSUMPTION — what the editor reads from this response has not been
// observed; adjust once it has.
.get('/cloud-builds/get-rate-limit-config', (c) =>
c.json({
maxBuildsPerHour: 100,
maxConcurrentBuilds: 10,
cooldownSeconds: 0,
})
)
// Who of this room's co-owners is standing in this subroom right now. Studio
// shows them as "Co-owners in Room" and reads a Result<List<int>>: `success`
// must be true and `error` null, or the editor throws; `value` is those
@@ -106,6 +106,16 @@ it('lists no cloud builds for a room', async () => {
expect(await res.json()).toEqual({ results: [], totalResults: 0 })
})
it('serves a stubbed cloud build rate limit config', async () => {
const res = await SELF.fetch('https://example.com/cloud-builds/get-rate-limit-config')
expect(res.status).toBe(200)
expect(await res.json()).toEqual({
maxBuildsPerHour: 100,
maxConcurrentBuilds: 10,
cooldownSeconds: 0,
})
})
describe('GET /collaboration/owners-in-room', () => {
const roomId = 1106
const subRoomId = 22941