feat(ssh/api): resolve circular structure issue

This commit is contained in:
perf3ct 2025-08-06 22:11:36 +00:00
parent 8ce5243c7b
commit 10aa9c539a
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
2 changed files with 4 additions and 2 deletions

View File

@ -66,7 +66,8 @@ class Api {
// crude stoppage attempt
let response = await httpClient.get(endpoint, queryParams);
if (lastReponse) {
if (JSON.stringify(lastReponse) == JSON.stringify(response)) {
// Compare only the response body to avoid circular reference issues
if (JSON.stringify(lastReponse.body) == JSON.stringify(response.body)) {
break;
}
}

View File

@ -252,7 +252,8 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver {
// crude stoppage attempt
let response = await httpClient.get(endpoint, queryParams);
if (lastReponse) {
if (JSON.stringify(lastReponse) == JSON.stringify(response)) {
// Compare only the response body to avoid circular reference issues
if (JSON.stringify(lastReponse.body) == JSON.stringify(response.body)) {
break;
}
}