Skip to content
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

[Bug] changing field type from text to checkbox causes exception #5360

Closed
zoli opened this issue May 18, 2024 · 4 comments · Fixed by #5366
Closed

[Bug] changing field type from text to checkbox causes exception #5360

zoli opened this issue May 18, 2024 · 4 comments · Fixed by #5366
Assignees
Labels
2024 bug Something isn't working database the underlying data of grid, kanban, cal regression This worked/were included in a previous verison, but stopped working in a new version

Comments

@zoli
Copy link
Contributor

zoli commented May 18, 2024

Bug Description

In board view changing field type from text to checkbox throws an exception when you hover the cursor on the card.
'CellController<CheckboxCellDataPB, String>' is not a subtype of type 'CellController<String, String>' in type

How to Reproduce

Open a card and create new field which its type is text by default. Change the field type to checkbox and close the card. Hover on any card and you get exception.
converting any field from CellController<String, String> to a CellController<SomeCellDataPB, String> causes exception.

Expected Behavior

Not throwing any exception.

Operating System

Linux

AppFlowy Version(s)

v0.5.7

Screenshots

No response

Additional Context

No response

@Xazin Xazin added bug Something isn't working regression This worked/were included in a previous verison, but stopped working in a new version 2024 database the underlying data of grid, kanban, cal labels May 18, 2024
@zoli
Copy link
Contributor Author

zoli commented May 18, 2024

From what I've learned the problem is TextCardCell not getting disposed. The field type changes from text to checkbox but it's still going with TextCardCell.

@Xazin
Copy link
Collaborator

Xazin commented May 18, 2024

From what I've learned the problem is TextCardCell not getting disposed. The field type changes from text to checkbox but it's still going with TextCardCell.

Most likely caused by recent changes to the database by @richardshiue, however he is on leave at the moment.

Do you want to pick up this issue @zoli? Else I'll find some time to resolve it before version 0.5.9.

@zoli
Copy link
Contributor Author

zoli commented May 18, 2024

Do you want to pick up this issue @zoli? Else I'll find some time to resolve it before version 0.5.9.

Yes, Currently I'm looking into it. When are you going to release 0.5.9?

@Xazin
Copy link
Collaborator

Xazin commented May 18, 2024

Do you want to pick up this issue @zoli? Else I'll find some time to resolve it before version 0.5.9.

Yes, Currently I'm looking into it. When are you going to release 0.5.9?

0.5.9 is scheduled for release on June 3rd, so still a little over 2 weeks left.

zoli added a commit to zoli/AppFlowy that referenced this issue May 19, 2024
Before this chaning any field from CellController<String, String>
to a CellController<SomeCellDataPB, String> caused exception.
The root of problem was that _CardContent wasn't getting rebuilt
when field type got changed. In CardState it was storing list of
CellContext which contains only field id and row id so on changing
field type the state wasn't changing.
I made a new type CellMeta which stores field type alongside row id
and field id and now CardState stores list of CellMeta.
zoli added a commit to zoli/AppFlowy that referenced this issue May 21, 2024
* main:
  fix: unable to remove the remote selection when the user close the page on mobile (AppFlowy-IO#5376)
  chore: add limitation when importing csv file (AppFlowy-IO#5381)
  fix: infinite loop when getting ancestor for orphan view (AppFlowy-IO#5375)
  fix: range error raise if heading level >= 6 (AppFlowy-IO#5373)
  fix: use full update states instead of patch update (AppFlowy-IO#5371)
  chore: update translations to consistently use appName instead of AppFlowy (AppFlowy-IO#5354)
  fix: changing field type from text to checkbox causes exception AppFlowy-IO#5360 (AppFlowy-IO#5366)
  fix: heading node validate failed (AppFlowy-IO#5370)
  chore: support Ukrainian language AppFlowy-IO#5350 (AppFlowy-IO#5369)
  chore: do not use the cell of given summary field (AppFlowy-IO#5362)
  chore: update translations with Fink 🐦 (AppFlowy-IO#5322)
  chore: update fr-FR.json (AppFlowy-IO#5356)
  fix: workspace icon displays incorrectly on Linux (AppFlowy-IO#5358)
  feat: support web grid preview (AppFlowy-IO#5353)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2024 bug Something isn't working database the underlying data of grid, kanban, cal regression This worked/were included in a previous verison, but stopped working in a new version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants