Skip to content

Conversation

yoyoyohamapi
Copy link
Contributor

No description provided.

Copy link
Contributor Author

yoyoyohamapi commented Apr 18, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@yoyoyohamapi yoyoyohamapi marked this pull request as ready for review April 18, 2025 06:57
@yoyoyohamapi yoyoyohamapi requested a review from a team as a code owner April 18, 2025 06:57
@graphite-app graphite-app bot requested review from a team April 18, 2025 06:58
@yoyoyohamapi yoyoyohamapi marked this pull request as draft April 18, 2025 06:58
Copy link

codecov bot commented Apr 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.15%. Comparing base (6c9f28e) to head (fbeca51).
Report is 569 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff             @@
##           canary   #11802      +/-   ##
==========================================
- Coverage   55.15%   55.15%   -0.01%     
==========================================
  Files        2614     2614              
  Lines      121648   121648              
  Branches    19380    19380              
==========================================
- Hits        67094    67092       -2     
+ Misses      53027    52498     -529     
- Partials     1527     2058     +531     
Flag Coverage Δ
server-test 78.41% <ø> (ø)
unittest 31.31% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.


this.workspaceServerService.server.gql({});
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file is missing a trailing newline at the end. This violates standard code formatting practices and may cause issues with some tools. Please add a newline character at the end of the file to ensure consistency with the codebase's style guidelines.

Spotted by Diamond (based on custom rules)

Is this helpful? React 👍 or 👎 to let us know.

Comment on lines 16 to 31
const handleReindexClick = React.useCallback(() => {
setIsIndexing(true);
setIndexingProgress(0);

// Simulated progress for demo
const interval = setInterval(() => {
setIndexingProgress(prev => {
if (prev >= 100) {
clearInterval(interval);
setIsIndexing(false);
return 100;
}
return prev + 10;
});
}, 1000);
}, []);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interval created in handleReindexClick isn't being cleaned up if the component unmounts during the indexing process. This could lead to memory leaks and continued state updates on an unmounted component. Consider adding a cleanup mechanism using either:

useEffect(() => {
  return () => {
    if (interval) {
      clearInterval(interval);
    }
  };
}, []);

Or store the interval ID in a ref and clear it in a cleanup function:

const intervalRef = useRef(null);

const handleReindexClick = React.useCallback(() => {
  // ...
  intervalRef.current = setInterval(() => {
    // ...
  }, 1000);
}, []);

useEffect(() => {
  return () => {
    if (intervalRef.current) {
      clearInterval(intervalRef.current);
    }
  };
}, []);
Suggested change
const handleReindexClick = React.useCallback(() => {
setIsIndexing(true);
setIndexingProgress(0);
// Simulated progress for demo
const interval = setInterval(() => {
setIndexingProgress(prev => {
if (prev >= 100) {
clearInterval(interval);
setIsIndexing(false);
return 100;
}
return prev + 10;
});
}, 1000);
}, []);
const intervalRef = React.useRef(null);
const handleReindexClick = React.useCallback(() => {
setIsIndexing(true);
setIndexingProgress(0);
// Clear any existing interval
if (intervalRef.current) {
clearInterval(intervalRef.current);
}
// Simulated progress for demo
intervalRef.current = setInterval(() => {
setIndexingProgress(prev => {
if (prev >= 100) {
clearInterval(intervalRef.current);
intervalRef.current = null;
setIsIndexing(false);
return 100;
}
return prev + 10;
});
}, 1000);
}, []);
React.useEffect(() => {
return () => {
if (intervalRef.current) {
clearInterval(intervalRef.current);
}
};
}, []);

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

}

export class Indexer extends Entity {
status$ = new LiveData<number>(this.store.status);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The status$ property is initialized with this.store.status at the class field level, which executes before the constructor runs. At that point, this.store is undefined, leading to a runtime error.

Consider either:

  1. Moving this initialization to the constructor:
constructor(
  private readonly workspaceService: WorkspaceService,
  private readonly store: IndexerStore,
) {
  super();
  this.status$ = new LiveData<number>(this.store.status);
}
  1. Using a getter pattern to ensure the value is accessed only when needed:
get status$() { 
  return new LiveData<number>(this.store.status); 
}

This will ensure the property is properly initialized after dependencies are available.

Suggested change
status$ = new LiveData<number>(this.store.status);
status$: LiveData<number>;
constructor(
private readonly workspaceService: WorkspaceService,
private readonly store: IndexerStore,
) {
super();
this.status$ = new LiveData<number>(this.store.status);
}

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_embedding_settings branch from 20c3068 to f4c7749 Compare April 21, 2025 06:35
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch from 1912ef3 to 44b54e6 Compare April 21, 2025 06:35
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_embedding_settings branch from f4c7749 to 7ca422a Compare April 24, 2025 03:46
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch from 44b54e6 to cde22a1 Compare April 24, 2025 03:46
Copy link
Contributor

coderabbitai bot commented Apr 24, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch from cde22a1 to 768b084 Compare April 25, 2025 08:58
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_embedding_settings branch 2 times, most recently from 4f5659b to b64a4df Compare April 25, 2025 09:01
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch 2 times, most recently from 4cf8e54 to d487be5 Compare April 29, 2025 10:15
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_embedding_settings branch from b64a4df to 83865db Compare April 29, 2025 10:15
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch from d487be5 to 2e559b8 Compare May 7, 2025 02:16
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_embedding_settings branch from 83865db to 95480b1 Compare May 7, 2025 02:17
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch from 2e559b8 to ad6527f Compare May 9, 2025 06:54
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_embedding_settings branch from 95480b1 to 41c158f Compare May 9, 2025 06:54
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch from ad6527f to 777bdf8 Compare May 9, 2025 09:13
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_embedding_settings branch from 41c158f to f865cf2 Compare May 9, 2025 09:13
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch from 777bdf8 to 69135f7 Compare May 12, 2025 02:42
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch from 4795161 to ced25fb Compare May 15, 2025 04:02
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_embedding_settings branch from 4a16e32 to f4534d3 Compare May 15, 2025 04:02
@graphite-app graphite-app bot changed the base branch from 04-18-feat_core_workspace_embedding_settings to graphite-base/11802 May 15, 2025 06:00
@graphite-app graphite-app bot force-pushed the 04-18-feat_core_workspace_indexing_settings branch from ced25fb to 80ad126 Compare May 15, 2025 06:56
@graphite-app graphite-app bot force-pushed the graphite-base/11802 branch from f4534d3 to 7c97c84 Compare May 15, 2025 06:56
@graphite-app graphite-app bot changed the base branch from graphite-base/11802 to 04-18-feat_core_workspace_embedding_settings May 15, 2025 06:56
@graphite-app graphite-app bot force-pushed the 04-18-feat_core_workspace_indexing_settings branch from 80ad126 to df95d7e Compare May 15, 2025 06:56
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_embedding_settings branch from 7c97c84 to d666a0e Compare May 15, 2025 07:37
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch 2 times, most recently from 657ebfe to 5f11632 Compare May 15, 2025 09:00
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_embedding_settings branch from d666a0e to b376f0b Compare May 15, 2025 09:00
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch from 5f11632 to bbf634f Compare May 15, 2025 09:08
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_embedding_settings branch 2 times, most recently from 9c9337f to 825c630 Compare May 15, 2025 09:23
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch from bbf634f to 9086e35 Compare May 15, 2025 09:23
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_embedding_settings branch from 825c630 to 5dfa32d Compare May 15, 2025 09:26
@yoyoyohamapi yoyoyohamapi force-pushed the 04-18-feat_core_workspace_indexing_settings branch from 9086e35 to ed5627f Compare May 15, 2025 09:26
@graphite-app graphite-app bot changed the base branch from 04-18-feat_core_workspace_embedding_settings to graphite-base/11802 May 15, 2025 09:37
@graphite-app graphite-app bot force-pushed the graphite-base/11802 branch from 5dfa32d to 6c9f28e Compare May 15, 2025 10:30
@graphite-app graphite-app bot force-pushed the 04-18-feat_core_workspace_indexing_settings branch from ed5627f to 5edc615 Compare May 15, 2025 10:30
@graphite-app graphite-app bot changed the base branch from graphite-base/11802 to canary May 15, 2025 10:31
@graphite-app graphite-app bot force-pushed the 04-18-feat_core_workspace_indexing_settings branch from 5edc615 to fbeca51 Compare May 15, 2025 10:31
@forehalo forehalo force-pushed the canary branch 4 times, most recently from 1c0c9fc to 8d77c48 Compare June 23, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants