Skip to content

Commit 7a8e238

Browse files
authored
fix(url): ensure main thread scheduling before fetching (#1453)
Call utils.schedule_main() before fetching URL data to ensure that subsequent operations run on the main thread. This prevents potential issues with asynchronous execution and improves reliability when accessing resources. Signed-off-by: Tomas Slusny <[email protected]>
1 parent 481db77 commit 7a8e238

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lua/CopilotChat/config/functions.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,7 @@ return {
545545
input.url = 'https://' .. input.url
546546
end
547547

548+
utils.schedule_main()
548549
local data, mimetype = resources.get_url(input.url)
549550
if not data then
550551
error('URL not found: ' .. input.url)

0 commit comments

Comments
 (0)