nextcloud / nextcloud/context_chat

auto_indexing=false is ignored; enabling context_chat 5.4.0 unconditionally queues all mounts

Open
#260 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug priority: normal
Dominant language
PHP
Stars
29
Forks
12
Avg merge
4d 4h
Merged PRs (30d)
5

Description

Which version of Nextcloud are you using?

34.0.2.1

Which version of PHP context_chat are you using?

5.4.0

Which version of backend context_chat are you using?

5.4.1

Nextcloud deployment method?

Bare-metal Apache/PHP with AppAPI and HaRP for ExApps.

Describe the bug

Setting context_chat app config auto_indexing to false before enabling the app does not prevent the initial crawl. After enabling context_chat 5.4.0, the app scheduled crawl jobs for every mount and inserted 8,527 file references into oc_context_chat_queue.

The setting was verified as false both before and after enabling the app.

Source review of the installed 5.4.0 release shows:

  • lib/Repair/AppInstallStep.php adds SchedulerJob during first install.
  • lib/BackgroundJobs/SchedulerJob.php enumerates all mounts and schedules StorageCrawlJob without checking auto_indexing.
  • lib/BackgroundJobs/StorageCrawlJob.php inserts file references into the queue without checking auto_indexing.
  • appinfo/info.xml exposes prompt, search, and stats, but no documented manual context_chat:scan command.
Expected behavior

When auto_indexing=false, enabling the app should not schedule an initial crawl or enqueue files automatically. An administrator should be able to complete provider configuration and explicitly start a controlled indexing operation later.

Actual behavior

Enabling the app scheduled all detected mounts regardless of the stored setting. In this case:

  • oc_context_chat_queue: 8,527 rows
  • oc_context_chat_content_queue: 0 rows
  • oc_context_chat_action_queue: 0 rows
  • oc_context_chat_fs_events: 0 rows

The deployment was stopped and cleaned up after detection.

Data-transmission note

No document content was transmitted externally in this reproduction. The content queue remained empty and the vector database remained empty. This was verified before cleanup.

Steps to reproduce
  1. Install context_chat_backend 5.4.1.
  2. Install context_chat 5.4.0 but keep it disabled.
  3. Set the app config value auto_indexing to false.
  4. Verify the stored value is false.
  5. Enable context_chat.
  6. Run the normal Nextcloud background-job cycle.
  7. Observe SchedulerJob/StorageCrawlJob activity and rows appearing in oc_context_chat_queue for all mounts.
Additional context

The backend's embedding provider configuration was incomplete in this deployment, but that is separate from this issue. It prevented content processing; it did not cause the unscoped crawl. The crawl is reproducible from the PHP app's scheduling path before successful embedding processing is available.

No hostnames, IP addresses, credentials, customer data, or private logs are included in this report.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/Repair/AppInstallStep.php, lib/BackgroundJobs/SchedulerJob.php, and lib/BackgroundJobs/StorageCrawlJob.php, then reproduce the normal Nextcloud background-job cycle with auto_indexing=false. Trace the scheduling and queue insertion paths to identify where the setting is ignored. Done means enabling the app does not schedule a crawl or enqueue mount files when auto_indexing=false.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.