Skip to content

bug(frontend): KBSearchResultPanel still creates duplicate KnowledgeRepository instance #3969

@mrveiss

Description

@mrveiss

Description

KBSearchResultPanel doesn't accept the repository prop passed from parent, and still creates its own instance. This defeats #3940's goal of eliminating duplicate repository creation.

Current state:

  • KnowledgeSearch.vue creates: const knowledgeRepo = new KnowledgeRepository()
  • KnowledgeSearch.vue passes: <KBSearchResultPanel :repository="knowledgeRepo" ... />
  • KBSearchResultPanel ignores it: No repository prop defined
  • KBSearchResultPanel creates its own: line 220 const knowledgeRepo = new KnowledgeRepository()
  • KBSearchResultPanel uses its own: line 308 await knowledgeRepo.getDocument(document.id)

Result: Two KnowledgeRepository instances in memory (parent's + child's)

Fix required:

  1. Add repository: KnowledgeRepository to KBSearchResultPanel props (line 199-203)
  2. Replace local const knowledgeRepo = new KnowledgeRepository() with the prop
  3. Update line 308 to use passed-in repository

Related: #3940, #3296

Type: bug
Priority: medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrontend

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions