Skip to content

Commit

Permalink
Fix low bandwidth subscriptions for structs
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Sep 6, 2023
1 parent 304c0ab commit e5d94d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/hub/Sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,16 @@ export default class Sidebar {
this.activeFieldCallbacks.push(() => {
let visible = fieldElement.getBoundingClientRect().height > 0;

// Add full key if available and array
// Add full key if available and array, raw, or string
// - raw in case of msgpack, struct, or ptoto
// - strin in case of JSON
if (
field.fullKey !== null &&
(window.log.getType(field.fullKey) === LoggableType.BooleanArray ||
window.log.getType(field.fullKey) === LoggableType.NumberArray ||
window.log.getType(field.fullKey) === LoggableType.StringArray)
window.log.getType(field.fullKey) === LoggableType.StringArray ||
window.log.getType(field.fullKey) === LoggableType.Raw ||
window.log.getType(field.fullKey) === LoggableType.String)
) {
if (visible) {
this.activeFields.add(field.fullKey);
Expand Down
2 changes: 1 addition & 1 deletion src/hub/dataSources/NT4Source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default class NT4Source extends LiveDataSource {
}

// Add active fields
let activeFields: Set<string> = new Set();
let activeFields: Set<string> = new Set([akitMode ? "/AdvantageKit/.schema" : "/.schema"]);
[...window.tabs.getActiveFields(), ...window.sidebar.getActiveFields()].forEach((key) => {
// Compare to announced keys
window.log.getFieldKeys().forEach((announcedKey) => {
Expand Down

0 comments on commit e5d94d1

Please sign in to comment.