[DocumentUrlDB] Catch invalid URLs early
ClosedPublic

Authored by bruns on Jun 9 2019, 2:23 PM.

Details

Summary

DocumentUrlDB::replace calls DocumentUrlDB::put, which silently
discards invalid URLs. In case of an invalid URL, the old URL/name
is removed from the DB, but the new one is never inserted.

Move the core of the function to a private helper (implementing both
delete and rename/move), and make replace a trivial wrapper.

Test Plan

ctest

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Jun 9 2019, 2:23 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptJun 9 2019, 2:23 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Jun 9 2019, 2:23 PM
bruns updated this revision to Diff 59451.Jun 9 2019, 3:23 PM
bruns edited the summary of this revision. (Show Details)
bruns edited the test plan for this revision. (Show Details)

split replace into private helper and wrapper

ngraham accepted this revision.Jun 10 2019, 4:26 PM

Yikes.

This revision is now accepted and ready to land.Jun 10 2019, 4:26 PM
This revision was automatically updated to reflect the committed changes.