Skip to content
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

Chat view ERR Error: Invalid range: [1, 0) #194373

Closed
jrieken opened this issue Sep 28, 2023 · 3 comments
Closed

Chat view ERR Error: Invalid range: [1, 0) #194373

jrieken opened this issue Sep 28, 2023 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority panel-chat verified Verification succeeded

Comments

@jrieken
Copy link
Member

jrieken commented Sep 28, 2023

In one of my workspaces I see no more chat. The console shows the stacktraces below, the debugger stops like this

Screenshot 2023-09-28 at 10 26 44
ERR Error: Invalid range: [1, 0)
    at new k (offsetRange.ts:48:10)
    at c.G (chatModel.ts:538:42)
    at chatModel.ts:525:65
    at Array.map (<anonymous>)
    at c.F (chatModel.ts:524:19)
    at new c (chatModel.ts:504:39)
    at g.j (instantiationService.ts:119:18)
    at g.createInstance (instantiationService.ts:85:18)
    at O (chatServiceImpl.ts:325:43)
    at O.getOrRestoreSession (chatServiceImpl.ts:404:15)
    at s.U (chatViewPane.ts:114:54)
    at s.render (paneview.ts:267:9)
    at s.render (viewPane.ts:286:9)
    at R.rb (viewPaneContainer.ts:778:9)
    at u.value (viewPaneContainer.ts:532:87)
    at c.z (event.ts:1138:13)
    at c.A (event.ts:1149:9)
    at c.fire (event.ts:1173:9)
    at b.I (viewContainerModel.ts:661:41)
    at b.H (viewContainerModel.ts:656:8)
    at u.value (viewContainerModel.ts:361:118)
    at c.z (event.ts:1138:13)
    at c.fire (event.ts:1169:9)
    at u.value (event.ts:152:97)
    at l.z (event.ts:1138:13)
    at l.A (event.ts:1149:9)
    at l.fire (event.ts:1173:9)
    at l.fire (event.ts:1335:11)
    at s.setContext (contextKeyService.ts:345:29)
    at u.reset (contextKeyService.ts:214:18)
    at new u (contextKeyService.ts:203:8)
    at s.createKey (contextKeyService.ts:290:10)
    at w (contextKeyService.ts:599:20)
    at g.invokeFunction (instantiationService.ts:68:11)
    at y.n (commandService.ts:95:46)
    at y.executeCommand (commandService.ts:60:17)
    at p.$executeCommand (mainThreadCommands.ts:91:31)
    at m.S (rpcProtocol.ts:456:17)
    at m.Q (rpcProtocol.ts:441:32)
    at m.M (rpcProtocol.ts:371:19)
    at m.L (rpcProtocol.ts:297:10)
    at u.value (rpcProtocol.ts:161:42)
    at c.z (event.ts:1138:13)
    at c.fire (event.ts:1169:9)
    at r.fire (ipc.net.ts:650:19)
    at Y.onmessage (localProcessExtensionHost.ts:581:40)
log.ts:441   ERR Invalid range: [1, 0): Error: Invalid range: [1, 0)
    at new k (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:95:32662)
    at c.G (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1575:1173)
    at vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1575:827
    at Array.map (<anonymous>)
    at c.F (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1575:779)
    at new c (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1575:326)
    at g.j (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:640:1241)
    at g.createInstance (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:640:733)
    at O (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1576:8061)
    at O.getOrRestoreSession (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1576:9336)
    at s.U (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2551:20103)
    at s.render (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:227:65895)
    at s.render (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1669:11445)
    at R.rb (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2537:37565)
    at u.value (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2537:34403)
    at c.z (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:1902)
    at c.A (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:1972)
    at c.fire (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:2188)
    at b.I (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2321:122034)
    at b.H (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2321:122006)
    at u.value (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2321:116441)
    at c.z (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:1902)
    at c.fire (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:2119)
    at u.value (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:85:49477)
    at l.z (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:1902)
    at l.A (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:1972)
    at l.fire (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:2188)
    at l.fire (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:3317)
    at s.setContext (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:638:35504)
    at u.reset (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:638:33917)
    at new u (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:638:33812)
    at s.createKey (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:638:34811)
    at w (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:638:38446)
    at g.invokeFunction (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:640:326)
    at y.n (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1528:12391)
    at y.executeCommand (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1528:11979)
    at p.$executeCommand (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1537:552)
    at m.S (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1551:18856)
    at m.Q (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1551:18622)
    at m.M (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1551:17715)
    at m.L (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1551:16794)
    at u.value (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1551:15597)
    at c.z (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:1902)
    at c.fire (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:87:2119)
    at r.fire (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:616:14335)
    at Y.onmessage (vscode-file:https://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1652:1077)
@jrieken jrieken assigned jrieken and roblourens and unassigned jrieken Sep 28, 2023
@jrieken jrieken added the important Issue identified as high-priority label Sep 28, 2023
jrieken added a commit that referenced this issue Sep 28, 2023
@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug panel-chat labels Sep 28, 2023
@roblourens roblourens added this to the September 2023 milestone Sep 28, 2023
@roblourens
Copy link
Member

omg, 1-indexed vs 0-indexed ranges... That is the fix, thanks for saving me from candidate shame

@roblourens
Copy link
Member

This would happen when a request body is empty. But probably the only way you would get in that state is if you had a session that was broken due to the issue that my original commit was fixing, which was broken chat session serialization. So I think the only way to verify it really is to check the window where you noticed the original issue. Or we can call it verified by code review.

@bhavyaus bhavyaus added the verified Verification succeeded label Sep 28, 2023
@bhavyaus
Copy link
Collaborator

verified by code review

@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority panel-chat verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants