Skip to content

fix: Ensure the warning is non longer option - older gets migrated#974

Open
aiAdrian wants to merge 3 commits into
mainfrom
973-older-netzgrafik-cause-an-warning-issue-when-missing-backward-travel-times-due-of-wrong-warning-check
Open

fix: Ensure the warning is non longer option - older gets migrated#974
aiAdrian wants to merge 3 commits into
mainfrom
973-older-netzgrafik-cause-an-warning-issue-when-missing-backward-travel-times-due-of-wrong-warning-check

Conversation

@aiAdrian

@aiAdrian aiAdrian commented May 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@louisgreiner

Copy link
Copy Markdown
Contributor

I cannot reproduce the bug this should fix. Can you provide such a json?

@aiAdrian

aiAdrian commented May 5, 2026

Copy link
Copy Markdown
Contributor Author

@aiAdrian aiAdrian self-assigned this May 7, 2026

@louisgreiner louisgreiner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the files, I reproduced the bug.

I'm not a fan of this approve, because it adds a manual migration that adds a lot of noise to the code. I wonder how, in this same file, backwardTravelTime sometimes includes a warning and sometimes not.

I will try to think of an alternative solution. Edit: I couldn't find other solution :s

@emersion

Copy link
Copy Markdown
Member

Can we instead adjust hasXXXWarning() functions to check for null and undefined instead of just for null? e.g.

  hasTravelTimeWarning(): boolean {
    return Boolean(this.travelTime.warning);
  }

@louisgreiner

Copy link
Copy Markdown
Contributor

The other concern I have is that old files have backwardTravelTime not having the field warning and if we don't migrate the data, importing and exporting such a file will result in a file still not including the warning attributes. Should we do something about it?

@aiAdrian

Copy link
Copy Markdown
Contributor Author

The questions is how we ensure that we are downwards compatible.

@louisgreiner

Copy link
Copy Markdown
Contributor

After some discussion, we could try this: #974 (comment)

@emersion emersion removed their request for review May 13, 2026 15:26
…when-missing-backward-travel-times-due-of-wrong-warning-check
@louisgreiner

Copy link
Copy Markdown
Contributor

@aiAdrian what do you think of this solution (#974 (comment))? It would avoid having a migration method called each time in the constructor

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.

Older Netzgrafik cause an warning issue, when missing backward travel times due of wrong warning check

3 participants