AppFlowy-IO / AppFlowy

Bring projects, wikis, and teams together with AI. AppFlowy is an AI collaborative workspace where you achieve more without losing control of your data. The best open source alternative to Notion.
https://www.appflowy.io
GNU Affero General Public License v3.0
58.03k stars 3.81k forks source link

[Bug] Deleting a referenced board results in a permanent CircularProgressIndicator. #2001

Closed a-wallen closed 1 year ago

a-wallen commented 1 year ago

Bug Description

If you add a referenced board to a page and delete the board, the page will have a permanent circular progress indicator.

How to Reproduce

  1. Create a new board.
  2. Reference the board inside of a page.
  3. Delete the board that you created earlier.
  4. Close the app.
  5. Open the app.
  6. Open the page where you added the referenced board. There will be a circular progress indicator that you cannot remove.

Expected Behavior

The referenced board should not show.

Operating System

Windows 10

AppFlowy Version(s)

main

Screenshots

image

Additional Context

No response

ThePrimeJnr commented 1 year ago

I have reproduced this bug, and would like this task to be assigned to me.

ThePrimeJnr commented 1 year ago

just checked and the bug doesn't only exist with boards but with grids as well

a-wallen commented 1 year ago

@DestinedCodes, thank you!

ThePrimeJnr commented 1 year ago

I just began working on it. I'll keep this space posted on my progress. I am applying for octernship, so an issue with the label "good first issue for devs" would be great.😊😊😊

a-wallen commented 1 year ago

I suspect the answer is in built_in_page_widget.dart

  @override
  Widget build(BuildContext context) {
    return FutureBuilder<dartz.Either<ViewPB, FlowyError>>(
      builder: (context, snapshot) {
        if (snapshot.hasData) {
          final board = snapshot.data?.getLeftOrNull<ViewPB>();
          if (board != null) {
            return _build(context, board);
          }
        }
        return const Center(
          child: CircularProgressIndicator(),
        );
      },
      future: AppBackendService().getView(appID, gridID),
    );
  }
ThePrimeJnr commented 1 year ago

I have fixed the bug. please review😊. It was interesting working on this, but it wasn't really easy to build the app on my laptop. (I had to do more debugging on my laptop than I had to fix the code πŸ˜‚)

annieappflowy commented 1 year ago

Fixed