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

Clean up validation/defaults handling #3453

Open
InfusOnWoW opened this issue Jan 25, 2022 · 0 comments
Open

Clean up validation/defaults handling #3453

InfusOnWoW opened this issue Jan 25, 2022 · 0 comments
Labels
🎨 Feature Request This is a request for a new feature, or an expansion of an existing feature.

Comments

@InfusOnWoW
Copy link
Contributor

We have in WeakAuras a per regionType table of "defaults", which we really use for two purposes.
a) Actually as defaults for new regions
b) As a type check for validation

This has lead to problems multiple times, so we should fix that by:
a) Either having a more explicit struture, e.g.

local defaults = {
  icon = {
    type = "bool",
    default = true
  },
  [....]
  subRegions = {
     type = "subRegion", -- ??? Special logic for handling subRegions in validation?
     default = {
       [1] = "subbackground",
       [2] = "subforeground"
    }
  }
}

b) Or two separate structures

In the same are there's trap. We do validation before we do modernization. The reason for that it was that way forever. I think that's done to make Modernize safer, since it can work on validated data. But this order has also lead to problems multiple times. So we should do imho two things:

a) Move validation to be after Modernization
b) Wrap Modernize in a pcall so that if it fails for an aura, we can print a error and continue.

@InfusOnWoW InfusOnWoW added the 🎨 Feature Request This is a request for a new feature, or an expansion of an existing feature. label Jan 25, 2022
@github-actions github-actions bot added the ⏱ Awaiting Response This ticket hasn't been triaged yet. label Jan 25, 2022
InfusOnWoW added a commit to InfusOnWoW/WeakAuras2 that referenced this issue Mar 17, 2024
InfusOnWoW added a commit to InfusOnWoW/WeakAuras2 that referenced this issue Mar 18, 2024
@InfusOnWoW InfusOnWoW reopened this Mar 18, 2024
@emptyrivers emptyrivers removed the ⏱ Awaiting Response This ticket hasn't been triaged yet. label Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎨 Feature Request This is a request for a new feature, or an expansion of an existing feature.
Projects
None yet
Development

No branches or pull requests

2 participants