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

Vaadin Flow Spreadsheet brakes serialization #6612

Open
AndriiRevaEpicor opened this issue Sep 5, 2024 · 2 comments
Open

Vaadin Flow Spreadsheet brakes serialization #6612

AndriiRevaEpicor opened this issue Sep 5, 2024 · 2 comments
Labels
known issue Known issue that can't be easily fixed refactor Internal improvement requires new major This would be a breaking change vaadin-spreadsheet

Comments

@AndriiRevaEpicor
Copy link

AndriiRevaEpicor commented Sep 5, 2024

Description

When we want to use Session replication using by Vaadin along with kubernetes-kit and Vaadin Flow Spreadsheet then the issue will occur that SpreadsheetHandlerImpl.java doesn't serializable.

Added link to a test project which help to reproduce this issue.

Stacktrace which describe the issue was added to the project and here as well. (non_serializable_issue_logs.txt)

Expected outcome

I'd like to expect that Vaadin Flow Spreadsheet is fully serializable that I can use it along with Session replication.

Minimal reproducible example

@Route
public class MainView extends VerticalLayout {

    private transient final Spreadsheet spreadsheet = new Spreadsheet();

    public MainView() {
        this.add(this.spreadsheet);
    }
}

Steps to reproduce

  1. Run application with two VM options to make sure that serializable logs shows: --add-opens java.base/java.io=ALL-UNNAMED -Dsun.io.serialization.extendedDebugInfo=true
  2. Check application logs and make sure that stacktrace the same as I attached to this github issue - (non_serializable_issue_logs.txt).

Environment

Vaadin version(s): 24.4.11
Kubernetes Kit version: 2.2.2
OS: Windows 11

Browsers

Issue is not browser related

@AndriiRevaEpicor AndriiRevaEpicor changed the title Vaadin Spreadsheet Flow brakes serialization Vaadin Flow Spreadsheet brakes serialization Sep 5, 2024
@sissbruecker
Copy link
Contributor

That is a know limitation of the component: https://vaadin.com/docs/latest/components/spreadsheet#limitations

@TatuLund
Copy link
Contributor

TatuLund commented Sep 6, 2024

I did some exploration on this. By introducing Serializable wrappers for the classes maintained in Spreadsheet state such as cell reference and cell range, making WeakHashMaps transients, Workbook etc. It could be possible to make it work. It may introduce breaking change. Especially that Workbook being transient and lost during serialization, so there should be a new API to set provider function for it or some other approach.

But Workbook being transient means that the burden for the user of Spreadsheet is not significantly different of making the whole Spreadsheet transient and re-create if is null after serialization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
known issue Known issue that can't be easily fixed refactor Internal improvement requires new major This would be a breaking change vaadin-spreadsheet
Projects
None yet
Development

No branches or pull requests

4 participants