-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LinkDB: do not use raw timestamps to index links #351
Comments
if I'm importing a list of links from a Firefox backup or something is this issue related? |
Definitely:
Regarding how it's handled when importing links in Shaarli, see if (empty($raw_add_date)) $raw_add_date=time(); // In case of shitty bookmark file with no ADD_DATE
// Make sure date/time is not already used by another link.
// (Some bookmark files have several different links with the same ADD_DATE)
// We increment date by 1 second until we find a date which is not used in DB.
// (so that links that have the same date/time are more or less kept grouped by date, but do not conflict.)
while (!empty($LINKSDB[date('Ymd_His',$raw_add_date)])) { $raw_add_date++; }// Yes, I know it's ugly.
$link['linkdate']=date('Ymd_His',$raw_add_date);
$LINKSDB[$link['linkdate']] = $link;
$import_count++;
There are two possibilities:
I'm not too fond of the second solution, as it implies keeping a compatibility layer, and is error-prone. |
Moving the milestone to 0.7.0 because that's something I'd like to see soon enough, and it's doable using the Updater class. |
Follow-up to: #347, #348
Relates to: #137, mro/Shaarli-API-test/issues/1
Impeded by: #324
Issue
Links are accessed using their timestamp, the format being
YYYYMMDD_HHmmSS
,thus, several links cannot be added during the same second.Though this has no impact for users (one rarely is fast enough to click this fast), this prevents batch-adding links and stress-testing Shaarli in automated test suites.
Todo
YYYYMMDD_HHmmSS_<id>
The text was updated successfully, but these errors were encountered: