toeverything/AFFiNE · error · Error

Unsupported value: ${params.value}

Error message

Unsupported value: ${params.value}

What it means

A value guard inside the shared-doc filter's 'is' method: after computing the set of shared doc ids, the boolean semantics only accept params.value of 'true' or 'false'. It fires when the rule's value is any other string, meaning the shared filter was given a non-boolean value; the interpolated value is the offending params.value.

Source

Thrown at packages/frontend/core/src/modules/collection-rules/impls/filters/shared.ts:41

        this.docsService.allDocIds$(),
      ]).pipe(
        onStart(() => {
          this.shareDocsListService.shareDocs?.revalidate();
        }),
        map(([shareDocsList, allDocIds]) => {
          const shareDocIds = new Set(shareDocsList.map(item => item.id));
          if (params.value === 'true') {
            return shareDocIds;
          } else if (params.value === 'false') {
            const notShareDocIds = new Set<string>();
            for (const id of allDocIds) {
              if (!shareDocIds.has(id)) {
                notShareDocIds.add(id);
              }
            }
            return notShareDocIds;
          } else {
            throw new Error(`Unsupported value: ${params.value}`);
          }
        })
      );
    }
    throw new Error(`Unsupported method: ${params.method}`);
  }
}

View on GitHub (pinned to b4c8548c09)

Solutions

  1. Pass a value of the expected type for this filter.
  2. Fix the filter params value.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown in the shared-docs filter when the filter value is neither 'true' nor 'false'.

Common situations: Occurs when a shared-docs filter has a non-boolean value, typically from malformed collection rules; set the value to true or false.


AI-assisted analysis of toeverything/AFFiNE@b4c8548c09 (2026-08-18). Data as JSON: /api/errors/7c1f3343d7bc0aef. Report an issue: GitHub.