Remove concept of dynamic metadata

Summary:
Although conceptually it made sense, it creates an issue with registration.

### Let me explain

Effectively, as an engineer, what constitutes static and dynamic metadata and how can I ensure that is treated as such?

It may be trivial to answer those questions but there was a fundamental assumption for static metadata that no longer holds true.  Static metadata was registered when descriptors were first referenced, which most of the times happens when added to the descriptors registry.

This used worked fine until we introduced the concept of deferred attributes.
Deferred attributes, even though static, may register its metadata only when requested to.

The issue is even more fundamental as not all the objects that declare static metadata will be loaded into memory by the time the plugin is connected and sends this.

### Solution

To simplify, as the concept was never really used, there's only metadata.

There's only pending metadata which is metadata that is yet to be sent to Flipper Desktop.

Reviewed By: LukeDefeo

Differential Revision: D41614186

fbshipit-source-id: 85d62eeff81ff22ae6e969d7b5aed8628b336258
This commit is contained in:
Lorenzo Blasa
2022-11-30 07:23:29 -08:00
committed by Facebook GitHub Bot
parent 4b83135c6c
commit d954828bbc
8 changed files with 37 additions and 61 deletions

View File

@@ -107,7 +107,7 @@ object ComponentDataExtractor {
val metadata = MetadataRegister.get(namespace, key)
val identifier =
metadata?.id
?: MetadataRegister.registerDynamic(
?: MetadataRegister.register(
MetadataRegister.TYPE_ATTRIBUTE, namespace, key, mutable, possibleValues)
return identifier
}