Skip to content

fix: sequelize field shadowing in models #1122

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

Merged
merged 1 commit into from
Jun 24, 2025
Merged

Conversation

tmigone
Copy link
Member

@tmigone tmigone commented May 23, 2025

This fixes an issue where model public fields shadow sequelize setters/getters making models's actual data undefined.

indexer-agent  | (sequelize) Warning: Model "IndexingRule" is declaring public class fields for attribute(s): "id", "identifier", "identifierType", "allocationAmount", "allocationLifetime", "autoRenewal", "parallelAllocations", "maxAllocationPercentage", "minSignal", "minStake", "maxSignal", "minAverageQueryFees", "custom", "decisionBasis", "requireSupported", "safety", "protocolNetwork", "createdAt", "updatedAt".
indexer-agent  | These class fields are shadowing Sequelize's attribute getters & setters.
indexer-agent  | See https://sequelize.org/main/manual/model-basics.html#caveat-with-public-class-fields

For details see https://sequelize.org/docs/v6/core-concepts/model-basics/#caveat-with-public-class-fields

@github-project-automation github-project-automation bot moved this to 🗃️ Inbox in Indexer May 23, 2025
@tmigone tmigone requested a review from dwerner May 23, 2025 13:05
@github-project-automation github-project-automation bot moved this from 🗃️ Inbox to ✅ Approved in Indexer Jun 24, 2025
@dwerner dwerner merged commit a7c8544 into main Jun 24, 2025
5 of 8 checks passed
@dwerner dwerner deleted the tmigone/sequelize-fix branch June 24, 2025 19:13
@github-project-automation github-project-automation bot moved this from ✅ Approved to 🚗 Merged in Indexer Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🚗 Merged
Development

Successfully merging this pull request may close these issues.

2 participants