Personal Telegram developer console for GitHub
test(g0): prevent PR patch source from leaking into Telegram
davoodmehraban89 committed
Oct 24, 2026 at 22:30 UTC
371d8de747380538a50725badfdeab4bb10136cb
1 file changed
+16
test/github-advanced-plugin.test.js
+16
@@ -400,3 +400,19 @@ test('PR diff pages request only the number of files they can render and expose
400
assert.match(view.text, /file-8\.js/);
401
assert.ok(callbacks(view).includes('prfiles:123:19:2'));
402
});
403
+
404
+test('PR file list never renders provider patch contents in Telegram', async () => {
405
+ const github = makeGitHub();
406
+ github.listPullRequestFiles = async () => [{
407
+ filename: 'src/example.js',
408
+ status: 'modified',
409
+ additions: 1,
410
+ deletions: 0,
411
+ patch: '+PRIVATE_SOURCE_SENTINEL_9281'
412
+ }];
413
+ const plugin = createGitHubPlugin({ github, menu: makeMenu() });
414
+ const view = await plugin.resolveCallback('prfiles:123:19:1').execute();
415
+ assert.match(view.text, /src\/example\.js/);
416
+ assert.doesNotMatch(view.text, /PRIVATE_SOURCE_SENTINEL_9281/);
417
+ assert.doesNotMatch(view.text, /<pre>/);
418
+});