Skip to content

some project-based feature bug fix #1420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

Emt-lin
Copy link
Contributor

@Emt-lin Emt-lin commented Apr 1, 2025

Bug

  1. the old project context cache file isn't deleted when cache updated.
  2. the context cache doesn't be updated when the source file updated.
  3. Since All those API(url、pdf api) calls are slow and expensive, so need to refactor project caching functionality.

Fixed

  1. Fixed issues with item 1 and item 2.
  2. Refactor project caching functionality.
  • 1.new cache structure.

      export interface ContextCache {
         markdownContext: string;
         webContexts: Record<string, string>; // URL -> context
         youtubeContexts: Record<string, string>; // URL -> context
         timestamp: number;
         markdownNeedsReload: boolean;
      }
  • 2.When the project configuration changed, markdownContext、webContexts/youtubeContexts will be processed differently

    • markdownContext: all markdownContext cache will be deleted.
    • webContexts/youtubeContexts: Remove context for URLs that no longer exist.
  • 3.Load project context steps

    • markdownContext: Only process if markdownNeedsReload flag is true or there is no existing content
    • webContexts/youtubeContexts: For each url, fetch from cache if available; otherwise, make API call load context.

@logancyang
Copy link
Owner

You should create the PR against 2.9.0-preview, not master. Check #1399

@Emt-lin Emt-lin changed the base branch from master to 2.9.0-preview April 4, 2025 14:40
@Emt-lin
Copy link
Contributor Author

Emt-lin commented Apr 7, 2025

@logancyang wait review

@logancyang
Copy link
Owner

Could you list what's been done in the PR in the description?

@Emt-lin
Copy link
Contributor Author

Emt-lin commented Apr 18, 2025

@logancyang wait review.

@logancyang
Copy link
Owner

@Emt-lin sorry for the late reply. Can you submit this PR to the private repo?

@Emt-lin
Copy link
Contributor Author

Emt-lin commented May 2, 2025

@Emt-lin sorry for the late reply. Can you submit this PR to the private repo?

yeah. Recently on vacation, resubmission after the holidays.

@Emt-lin
Copy link
Contributor Author

Emt-lin commented May 10, 2025

will resubmit this PR in the preview repo

@Emt-lin Emt-lin closed this May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants