Skip to content

[Bug] File-derived documents are invisible under Pages category in v2.2.17+ due to conflicting sourceType/category filters #19786

Description

@haoran1231-ui

📱 Client Type

Other

💻 Operating System

macOS

📦 Deployment Platform

No response

📌 Version

v2.2.17

🌐 Browser

Other, Chrome

🐛 What happened?

Since v2.2.17+, file-derived documents are not visible under the Pages category. The documentArm condition ne(d.sourceType, 'file') and buildFileCategoryFilter returning 'none' for Pages are mutually exclusive, which produces an empty result set.
Impact
Users cannot see file-derived documents under the Pages category. The category appears empty, which makes file-derived pages effectively inaccessible through this filter path.

📷 How to reproduce it?

Use a build affected by v2.2.17+.

Navigate to or select the Pages category.

Look for file-derived documents.

Observe that no file-derived documents are displayed
Category filter: Pages

documentArm / file category filter

🚦 What it should be?

Root Cause
The issue appears to be caused by two conflicting filters:

js
ne(d.sourceType, 'file')
This excludes file-sourced documents from the document arm.

js
buildFileCategoryFilter(category) // Pages => 'none'
For the Pages category, the filter evaluates to 'none', which further filters out the file/document arm.

Because one filter excludes sourceType === 'file' and the other prevents the files arm from passing anything for Pages, the combined result is an empty set.

Suggested Fix
When category === 'Pages', exempt the sourceType exclusion, or let the files arm allow custom / document when the category is Pages.

Example direction:

ts
const shouldExcludeFile = category !== 'Pages' && ne(d.sourceType, 'file');
or:

ts
if (category === 'Pages') {
// do not apply the sourceType exclusion
// or allow custom/document in the files arm
}

📝 Additional Information

Root Cause
The issue appears to be caused by two conflicting filters:

js
ne(d.sourceType, 'file')
This excludes file-sourced documents from the document arm.

js
buildFileCategoryFilter(category) // Pages => 'none'
For the Pages category, the filter evaluates to 'none', which further filters out the file/document arm.

Because one filter excludes sourceType === 'file' and the other prevents the files arm from passing anything for Pages, the combined result is an empty set.

Suggested Fix
When category === 'Pages', exempt the sourceType exclusion, or let the files arm allow custom / document when the category is Pages.

Example direction:

ts
const shouldExcludeFile = category !== 'Pages' && ne(d.sourceType, 'file');
or:

ts
if (category === 'Pages') {
// do not apply the sourceType exclusion
// or allow custom/document in the files arm
}

🛠️ Willing to Submit a PR?

None

✅ Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a LobeChat issue and not a third-party library or provider issue.
  • Check that this is a concrete bug. For Q&A, please use GitHub Discussions or join our Discord Server.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    unconfirmNot yet confirmed by maintainers

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions