Personal Telegram developer console for GitHub
test: align workspace upload limits with editor policy
davoodmehraban89 committed
Oct 4, 2026 at 11:23 UTC
9e01abf857516b0cb31c4612afe5fd1cb1804bbf
1 file changed
+6
-6
test/github-workspace-file-upload.test.js
+6
-6
@@ -68,7 +68,7 @@ function makePlugin() {
68
return { workspaces, plugin: createGitHubPlugin({ github, menu: makeMenu(), workspaces }) };
69
}
70
71
-test('workspace exposes a primary file-upload input route with Telegram-safe callback data', async () => {
71
+test('workspace keeps file upload as a secondary bounded draft input route', async () => {
72
const { workspaces, plugin } = makePlugin();
73
const workspaceView = await plugin.resolveCallback(`ws:${WORKSPACE_ID}`, { ownerId: OWNER }).execute();
74
const buttons = workspaceView.reply_markup.inline_keyboard.flat();
@@ -80,8 +80,8 @@ test('workspace exposes a primary file-upload input route with Telegram-safe cal
80
const route = plugin.resolveCallback(upload.callback_data, { ownerId: OWNER });
81
assert.equal(route.actionId, 'github.workspace.input.prepare');
82
const prompt = await route.execute();
83
- assert.match(prompt.text, /12,?000|12000/);
84
- assert.match(prompt.text, /3,?000|3000/);
83
+ assert.match(prompt.text, /65,?536|65536/);
84
+ assert.match(prompt.text, /20,?000|20000/);
85
assert.match(prompt.text, /UTF-?8|فایل/i);
86
assert.deepEqual(await workspaces.getPendingInput({ ownerId: OWNER }), {
87
workspaceId: WORKSPACE_ID,
@@ -105,7 +105,7 @@ test('uploaded text file replaces only the local draft and preserves the reposit
105
assert.equal(await workspaces.getPendingInput({ ownerId: OWNER }), null);
106
});
107
108
-test('bot downloads a pending workspace document and dispatches its decoded file payload', async () => {
108
+test('bot downloads a pending workspace document using the expanded workspace byte ceiling', async () => {
109
const bot = new NexaDevBot({});
110
const calls = [];
111
bot.workspaceStore = {
@@ -139,7 +139,7 @@ test('bot downloads a pending workspace document and dispatches its decoded file
139
});
140
141
assert.equal(result.workspaceInput, true);
142
- assert.deepEqual(calls.find(call => call[0] === 'downloadTextFile'), ['downloadTextFile', 'FILE123', { maxBytes: 12000 }]);
142
+ assert.deepEqual(calls.find(call => call[0] === 'downloadTextFile'), ['downloadTextFile', 'FILE123', { maxBytes: 65536 }]);
143
const dispatch = calls.find(call => call[0] === 'dispatchMessage');
144
assert.deepEqual(dispatch[1].file, {
145
name: 'replacement.txt',
@@ -189,7 +189,7 @@ test('oversized Telegram document is rejected before download or workspace dispa
189
const result = await bot.handleMessage({
190
chat: { id: 7 },
191
from: { id: 42 },
192
- document: { file_id: 'HUGE', file_name: 'huge.txt', file_size: 12001 }
192
+ document: { file_id: 'HUGE', file_name: 'huge.txt', file_size: 65537 }
193
});
194
assert.equal(result.inputRejected, true);
195
assert.equal(downloads, 0);