-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve support for the Federation Extension #63
- Loading branch information
Showing
6 changed files
with
111 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,26 @@ class Logs { | |
* @type {Connection} | ||
*/ | ||
this.connection = connection; | ||
/** | ||
* @protected | ||
* @type {string} | ||
*/ | ||
this.endpoint = endpoint; | ||
/** | ||
* @protected | ||
* @type {string} | ||
*/ | ||
this.lastId = ""; | ||
/** | ||
* @protected | ||
* @type {?string} | ||
*/ | ||
this.level = level; | ||
/** | ||
* @protected | ||
* @type {Set<String>} | ||
Check warning on line 38 in src/logs.js GitHub Actions / checks
Check warning on line 38 in src/logs.js GitHub Actions / checks
|
||
*/ | ||
this.missing = new Set(); | ||
} | ||
|
||
/** | ||
|
@@ -37,6 +54,19 @@ class Logs { | |
return Array.isArray(response.logs) ? response.logs : []; | ||
} | ||
|
||
/** | ||
* Retrieves the backend identifiers that are (partially) missing in the logs. | ||
* | ||
* This is only filled after the first request using `nextLogs` or `next`. | ||
* | ||
* @returns {Array.<string>} | ||
* @see {Logs#nextLogs} | ||
* @see {Logs#next} | ||
*/ | ||
getMissingBackends() { | ||
return Array.from(this.missing); | ||
} | ||
|
||
/** | ||
* Retrieves the next log entries since the last request. | ||
* | ||
|
@@ -64,7 +94,13 @@ class Logs { | |
else { | ||
response.data.logs = []; | ||
} | ||
|
||
response.data.links = Array.isArray(response.data.links) ? response.data.links : []; | ||
|
||
if (Array.isArray(response.data["federation:missing"])) { | ||
response.data["federation:missing"].forEach(backend => this.missing.add(backend)); | ||
} | ||
|
||
return response.data; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters