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

this.writeIndexAlias should be read-only? #66

Open
qjhart opened this issue Aug 22, 2023 · 0 comments
Open

this.writeIndexAlias should be read-only? #66

qjhart opened this issue Aug 22, 2023 · 0 comments

Comments

@qjhart
Copy link
Contributor

qjhart commented Aug 22, 2023

Previous versions of dams, had indexAlias in their constructor,

this.writeIndexAlias = 'foo'

This messes up code, and shouldn't be allowed. Specifically, the cupdate function eg. uses this.writeIndexAlias while the setAlias function fixes up names that that don't match.

Easiest fix is to disallow renaming? This is one potential fix in FinEsDataModel

    Object.defineProperty(this, "readIndexAlias", {
      value: modelName+'-read',
      writable: false, // This makes the property read-only
      enumerable: true,
      configurable: false // This prevents reconfiguration of the property
    });

    Object.defineProperty(this, "writeIndexAlias", {
      value: modelName+'-write',
      writable: false, // This makes the property read-only
      enumerable: true,
      configurable: false // This prevents reconfiguration of the property
    });
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

No branches or pull requests

1 participant