Skip to content

Commit 88ecf8d

Browse files
committed
Fix API metadata not updating + Detect AI edits + Fix untitled project names + Introduce full system logging + Add toggle debug messages command
1 parent 944c26c commit 88ecf8d

7 files changed

Lines changed: 198 additions & 78 deletions

File tree

vscode-extension/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
"contributes": {
1717
"commands": [
1818
{
19-
"command": "chronicle.helloWorld",
20-
"title": "Hello World"
19+
"command": "chronicle.toggleDebug",
20+
"title": "Chronicle: Toggle Debugging"
2121
},
2222
{
2323
"command": "chronicle.apiKey",
24-
"title": "Set API Key"
24+
"title": "Chronicle: Set API Key"
2525
}
2626
],
2727
"configuration": {
2828
"title": "Chronicle",
2929
"properties": {
30-
"chronicle.apiKey": {
31-
"type": "string",
32-
"description": "Your API key for the Chronicle service."
30+
"chronicle.allowDebug": {
31+
"type": "boolean",
32+
"description": "Allow debugging of the Chronicle extension."
3333
}
3434
}
3535
}

vscode-extension/src/api_requester.ts

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,12 @@ export class APIRequester {
5858
})
5959

6060
const json_response: any = await response.json()
61+
const data = json_response.data.setApiMetadata
6162

62-
if (json_response.errors) {
63-
console.error('GraphQL Errors:', json_response.errors)
64-
throw new Error('Failed to set API metadata')
63+
if (data.errors.length > 0) {
64+
throw new Error('Failed to set API metadata', { cause: data.errors })
6565
}
6666

67-
const data = json_response.data.setApiMetadata
68-
6967
return data.success
7068
}
7169

@@ -79,13 +77,6 @@ export class APIRequester {
7977
}
8078
`
8179

82-
console.log(
83-
JSON.stringify({
84-
query,
85-
variables: { session: heartbeat.session },
86-
})
87-
)
88-
8980
const response = await fetch(APIRequester.API_URL, {
9081
method: 'POST',
9182
headers: {
@@ -99,16 +90,12 @@ export class APIRequester {
9990
})
10091

10192
const json_response: any = await response.json()
93+
const data = json_response.data.heartbeat
10294

103-
console.log(json_response)
104-
105-
if (json_response.errors) {
106-
console.error('GraphQL Errors:', json_response.errors)
107-
throw new Error('Failed to send heartbeat')
95+
if (data.errors.length > 0) {
96+
throw new Error('Failed to send heartbeat', { cause: data.errors })
10897
}
10998

110-
const data = json_response.data.heartbeat
111-
11299
return data.success
113100
}
114101
}

0 commit comments

Comments
 (0)