Skip to content

fix: remove the Indexing progress message when exeption in withHieDb#3610

Merged
michaelpj merged 3 commits into
masterfrom
fix_indexing_message_progress
Jun 2, 2023
Merged

fix: remove the Indexing progress message when exeption in withHieDb#3610
michaelpj merged 3 commits into
masterfrom
fix_indexing_message_progress

Conversation

@guibou

@guibou guibou commented May 28, 2023

Copy link
Copy Markdown
Collaborator

If any exception was happening in withHieDb, the post action was never called, leading to a stale Indexing message in the client.

By using bracket, we ensure that the post message is called in the event of an exception, cleaning the confusing message in the client.

It does not change the well behaving of the indexing (i.e. if it was crashing, it is still crashing), but at least user won't be confused by a stale Indexing message.

See #2931 for an example when an exception can happen during the indexing.

@guibou
guibou requested a review from pepeiborra as a code owner May 28, 2023 11:12
@guibou

guibou commented May 28, 2023

Copy link
Copy Markdown
Collaborator Author

I tried this code for one week at work (super large haskell codebase (hls takes 3 to 5 minutes to start), 2k+ modules, 20 devs) and the stuck Indexing message does not appears anymore.

@fendor fendor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

What do you think about adding your reasoning to the code here?

Comment thread ghcide/src/Development/IDE/Core/Compile.hs

@wz1000 wz1000 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems like a good idea

Comment thread ghcide/src/Development/IDE/Core/Compile.hs Outdated
If any exception was happening in `withHieDb`, the `post` action was
never called, leading to a stale `Indexing` message in the client.

By using `bracket`, we ensure that the `post` message is called in the
event of an exception, cleaning the confusing message in the client.

It does not change the well behaving of the indexing (i.e. if it was
crashing, it is still crashing), but at least user won't be confused by
a stale `Indexing` message.
@guibou
guibou force-pushed the fix_indexing_message_progress branch from 9014f48 to beffb29 Compare May 28, 2023 12:23
@guibou

guibou commented May 28, 2023

Copy link
Copy Markdown
Collaborator Author

LGTM!

What do you think about adding your reasoning to the code here?

I've added a comment.

@guibou
guibou requested a review from fendor May 28, 2023 12:25
Comment thread ghcide/src/Development/IDE/Core/Compile.hs

@fendor fendor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM :)

@michaelpj
michaelpj enabled auto-merge (squash) June 1, 2023 15:33
@michaelpj
michaelpj merged commit 50efbbb into master Jun 2, 2023
smunix pushed a commit to smunix/haskell-language-server that referenced this pull request Jun 10, 2023
haskell#3610)

If any exception was happening in `withHieDb`, the `post` action was
never called, leading to a stale `Indexing` message in the client.

By using `bracket`, we ensure that the `post` message is called in the
event of an exception, cleaning the confusing message in the client.

It does not change the well behaving of the indexing (i.e. if it was
crashing, it is still crashing), but at least user won't be confused by
a stale `Indexing` message.

Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
@fendor fendor mentioned this pull request Aug 8, 2023
19 tasks
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.

4 participants