Skip to content
Snippets Groups Projects
Commit f4186b6d authored by Rick Pasetto's avatar Rick Pasetto
Browse files

PARTIAL FIX (workaround) DEV-41949: LLMediaEntry::setWhitelist() and...

PARTIAL FIX (workaround) DEV-41949: LLMediaEntry::setWhitelist() and LLMediaEntry::asLLSD() have a contract conflict
Review #31

So, here's what was happening, briefly:

- LLMediaEntry::setWhitelist() would be a no-op if given an LLSD that did not have a WHITELIST_KEY
- LLMediaEntry::asLLSD() would render the LLMediaEntry *without* a WHITELIST_KEY if the whitelist was empty

Therefore, when the viewer marshalled an LLMediaEntry for the server, it would send it without a WHITELIST_KEY. When the server got it, it would not erase the last value.

This is actually a workaround: it patches asLLSD() with an LLSD::emptyArray() if the key is not there. However, this should be fixed on the server: in either or both of the following ways:

1) LLMediaEntry::setWhitelist() should not be a no-op if the LLSD has no WHITELIST_KEY: it should erase the whitelist
2) LLMediaEntry::asLLSD() should render an empty whitelist in WHITELIST_KEY as an empty array

Note that both could be done and still work.

A unit test should and will be written next.
parent ebbb468a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment