gloda Noun IDs are not persisted

NEW
Unassigned

Status

MailNews Core
Database
--
trivial
10 years ago
5 years ago

People

(Reporter: asuth, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 years ago
Global database (gloda) Noun IDs which are not hardcoded are not persisted to the database.  This currently does not pose a problem, but could at some point.  This bug is being logged to track this.

The discussion preceding the content of this bug between dmose and myself:

(dmose) does having _nextNounID not be persisted means that ids saved in the database could change across Thunderbird invocations if for some reason the ordering of calls to defineNoun change? If so, that seems fragile...

(asuth) Correct, noun id's are neither stable nor consistent (except for the internal, hard-coded ones). However, noun id's never touch the database at this time, so it's more a question of being confusing/useless for debugging. (Our full knowledge of attributes currently relies on them being registered at the start of every session; we don't persist their noun info. Given our current feature-set, this does not preclude the ability to garbage collect unused attributes.)

The existence of noun id's at this point is effectively an optimization, since their canonical identifier is either their name or the NOUN_ID constant on their data model class's prototype. They only would need to be persisted if/when we start putting them in the database for generic references that do not rely on parameterized attributes. Which is to say, we could create a "generic-reference" attribute whose parameter is the name of the noun that it is a generic-reference too. That neatly avoids having the noun id touch the database and allows easy introspection. I'm not sure that's the right solution to whatever problem would drive such a need, though.

Would you prefer that move to using some centralized noun ID registry or begin persisting the noun ID's to head off our likely future need?

(dmose) I don't think that needs to be done before landing. Please just track this issue somewhere (a bug, wiki page, wherever), and let's deal with it when a concrete need arises.
(Reporter)

Updated

10 years ago
Summary: global database Noun IDs are not persisted → gloda Noun IDs are not persisted
You need to log in before you can comment on or make changes to this bug.