Closed Bug 1779663 Opened 4 years ago Closed 4 years ago

Tidy up nsMsgFolder.getStringProperty and add methods to remove/existence-test properties

Categories

(Thunderbird :: General, task)

Thunderbird 102
task

Tracking

(thunderbird_esr102 wontfix)

RESOLVED FIXED
105 Branch
Tracking Status
thunderbird_esr102 --- wontfix

People

(Reporter: benc, Assigned: benc)

References

Details

Attachments

(1 file)

Following up from Bug #1778888.

in nsMsgFolder:

  • add hasStringProperty() for existence check
  • add removeStringProperty()
  • document getStringProperty in idl file
  • add test coverage of *StringProperty() methods

in nsMsgFolderCacheElement:

  • numeric accessors to return 0 for actual null values in folderCache.json (to bring them in line with getCachedString())
  • return NS_ERROR_NOT_AVAILABLE to better indicate missing entries (rather than NS_ERROR_FAILURE)
  • unit test to cover returning zero/"" for null entries in folderCache.json.
  • numeric accessors should return 0 when reading string values?
See Also: → 1778888
See Also: 1778888 →

For nsIMsgFolder.(get|set)StringProperty methods:

  • IDL comments to document them.
  • Add basic test coverage.
  • Add support for non-latin chars in values.

In nsMsgFolderCacheElement:

  • Numeric accessors to return 0 for actual null values in folderCache.json (to bring them in line with getCachedString())
  • Return NS_ERROR_NOT_AVAILABLE to better indicate missing entries (rather than NS_ERROR_FAILURE)
  • Unit test to cover returning zero/"" for null entries in folderCache.json.

That patch doesn't add .hasStringProperty() or .removeStringProperty() to nsIMsgFolder, as I originally intended. I decided to avoid these as they'd require new mork code.
If anyone really needs that functionality it be handled in some other bug. In any case, .hasStringProperty() can already be handled via exceptions, and I'm not sure .removeStringProperty() would ever really be used.

I also discovered that get/setStringProperty() would mangle strings with non-latin characters. I changed their IDL definitions to use AUTF8String instead of ACString, which seems to do the trick. Hopefully no addons are relying on the old mangling behaviour :-)

try run looks OK:
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=d2a24406623b1be4dd18e779c1dc48f11c374b4e

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/8dcf8970879e
Tighten up folder string properties and their caching. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: