[GH-ISSUE #4591] [Bug] Selecting an Unsplash image for Cover is crashing the app #2054

Closed
opened 2026-03-23 21:19:16 +00:00 by mirror · 0 comments
Owner

Originally created by @dromerolovo on GitHub (Feb 2, 2024).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/4591

Originally assigned to: @LucasXu0 on GitHub.

Bug Description

Selecting an Unsplash image for Cover is crashing the app on development (AF: Build dart only) and the relsease version v0.4.5 for windows (downloaded https://appflowy.io/downloaded) just shows a grey image.

vs code debug (AF: Build dart only):
image

v0.4.5 for windows:
image

How to Reproduce

Development:

  1. AF-desktop: Clean + Rebuild All
  2. AF: Build Dart Only
  3. Add Cover
  4. Choose Unsplash
  5. Select an image

release v 0.4.5

  1. Download the app for windows
  2. Open it
  3. Add Cover
  4. Choose Unsplash
  5. Select an image

Expected Behavior

The cover section should show an image from Unsplash

Operating System

Windows 11 Home

AppFlowy Version(s)

Last commit pulled: chore: remove unused build and add build bot (#4586)

Screenshots

No response

Additional Context

A workaround or a solution is to add the following check to the conditional logic:

Map<String, String> _header() {
    final header = <String, String>{};
    final token = userProfilePB?.token;
    //token.isNotEmpty added
    if (token != null && token.isNotEmpty) {
      header['Authorization'] = 'Bearer ${jsonDecode(token)['access_token']}';
    }
    return header;
  }
Originally created by @dromerolovo on GitHub (Feb 2, 2024). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/4591 Originally assigned to: @LucasXu0 on GitHub. ### Bug Description Selecting an Unsplash image for Cover is crashing the app on development (AF: Build dart only) and the relsease version v0.4.5 for windows (downloaded https://appflowy.io/downloaded) just shows a grey image. vs code debug (AF: Build dart only): ![image](https://github.com/AppFlowy-IO/AppFlowy/assets/49217428/33fd7dfd-07bf-4be5-9b24-19258b4cae14) v0.4.5 for windows: ![image](https://github.com/AppFlowy-IO/AppFlowy/assets/49217428/3dec98ca-9697-4ec2-a3e0-fb7293586b49) ### How to Reproduce Development: 1. AF-desktop: Clean + Rebuild All 2. AF: Build Dart Only 3. Add Cover 4. Choose Unsplash 5. Select an image release v 0.4.5 1. Download the app for windows 2. Open it 3. Add Cover 4. Choose Unsplash 5. Select an image ### Expected Behavior The cover section should show an image from Unsplash ### Operating System Windows 11 Home ### AppFlowy Version(s) Last commit pulled: chore: remove unused build and add build bot (#4586) ### Screenshots _No response_ ### Additional Context A workaround or a solution is to add the following check to the conditional logic: ``` Map<String, String> _header() { final header = <String, String>{}; final token = userProfilePB?.token; //token.isNotEmpty added if (token != null && token.isNotEmpty) { header['Authorization'] = 'Bearer ${jsonDecode(token)['access_token']}'; } return header; }
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#2054
No description provided.