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

Revert setting Document#_stats#coreVersion in the pack builder #14600

Merged
merged 1 commit into from
May 4, 2024

Conversation

In3luki
Copy link
Collaborator

@In3luki In3luki commented May 4, 2024

Maybe this should only be added to the packs in development builds?

@CarlosFdez
Copy link
Collaborator

Probably so. It might be good to pull from system.json as well if we can (the verified version? The min version? Might need to be the min version)

@In3luki In3luki changed the title Bump supported core pack schema version to 12.321 Build packs for development with Document#_stats#coreVersion set to the minimum core version in system.json May 4, 2024
@In3luki In3luki changed the title Build packs for development with Document#_stats#coreVersion set to the minimum core version in system.json Build packs for development with Document#_stats#coreVersion set to the minimum core version in system.json May 4, 2024
@In3luki
Copy link
Collaborator Author

In3luki commented May 4, 2024

The json arg is only used for releases so this should be safe.
The only caveat is that now every system release will trigger a pack migration for the user.

@CarlosFdez
Copy link
Collaborator

CarlosFdez commented May 4, 2024

Wouldn't that already happen because every system reason replaces all of the database files? I guess one could argue its not useful to even put in that data if that happens I guess.

@In3luki
Copy link
Collaborator Author

In3luki commented May 4, 2024

The trigger for a server-side migration is _stats.coreVersion being lower than the current foundry build version or missing.
As we wouldn't include _stats for production builds after this change, it would always run for new release builds.

@In3luki
Copy link
Collaborator Author

In3luki commented May 4, 2024

It's a bit of a mess to manually keep track of supported server-side migrations as it involves unminifying a core file to look for changes in a _migrationRegistry property.

@In3luki
Copy link
Collaborator Author

In3luki commented May 4, 2024

I think it would actually be better to not strip the value on extract instead of adding it back on build.
Then I'd be:

  • Build packs
  • Start server and let it run migrations
  • Extract packs with updated _stats.coreVersion
  • Done

@CarlosFdez
Copy link
Collaborator

CarlosFdez commented May 4, 2024

Wouldn't it also migrate for dev builds as well if set to the min version and the dev is currently running a later version?

Could be that there's really no good way around it. It could be that the slow load time is mostly console log noise. Unless of course its possible for foundry to load a db for a core version that's greater than it? Then the solution might be stripping the verified version.

Not stripping the value on extract would lead it to be based on who contributed, which is going to not really be that consistent.

@In3luki
Copy link
Collaborator Author

In3luki commented May 4, 2024

I tried commenting out the logs but it didn't do much. It's really just the system having a ton of documents to traverse.

@CarlosFdez
Copy link
Collaborator

I meant foundry server logs primarily. I don't recall it being nearly that slow in v11, but in v11 I run the windows application. If that is what you meant by commenting out, I suppose not much can be done for it.

@CarlosFdez
Copy link
Collaborator

CarlosFdez commented May 4, 2024

If foundry can load documents of later foundry versions and doesn't prevent its load, then setting it to the verified version is what I think it should do (if it were not compatible, the min would be increased after all). Otherwise perhaps not including it at all is the correct play.

@In3luki In3luki changed the title Build packs for development with Document#_stats#coreVersion set to the minimum core version in system.json Revert setting Document#_stats#coreVersion in the pack builder May 4, 2024
@In3luki
Copy link
Collaborator Author

In3luki commented May 4, 2024

Reverted back to v11 state.

@CarlosFdez CarlosFdez merged commit 4df4917 into foundryvtt:v12 May 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants