Error when importing ics file (TB 102 not working, TB91 working) - when multiline description not properly folded
Categories
(Calendar :: ICAL.js Integration, defect)
Tracking
(Not tracked)
People
(Reporter: frederic.gai, Unassigned)
References
Details
(Keywords: regression)
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0
Steps to reproduce:
Try to import an isc file (see attachment) into a local agenda.
Actual results:
1- Import an .ics file inside a local agenda (Event/tasks menu, import option)
2- At step 1 of import UI, I select the ics file to import
3- At step 2 of import UI, an error message pop up stating that "No item that could be imported found in the file" and the import process is stuck at step 2
Expected results:
The event/task from the file should have been imported into the local.
This is not work with TB 102 but work like a charm with TB 91. Looks like a regression.
From the error console :
uncaught exception: ParserError: invalid line (no token ";" or ":") "Informer le RIF pour étude de faisabilité." CalIcsParser.jsm:153:39
Calendar: ParserError: invalid line (no token ";" or ":") "Informer le RIF pour tude de faisabilit."'ParserError: invalid line (no token ";" or ":") "Informer le RIF pour tude de faisabilit."' when calling method: [calIICSService::parseICS] when parsing
BEGIN:VCALENDAR
PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Europe/Paris
X-LIC-LOCATION:Europe/Paris
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
TZNAME:CEST
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
TZNAME:CET
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
END:STANDARD
END:VTIMEZONE
BEGIN:VTODO
CREATED:20221012T182437Z
LAST-MODIFIED:20221012T182437Z
DTSTAMP:20221012T182437Z
UID:4cbf78ab-21ba-4a36-86b0-82b8c609f806
SUMMARY:[VP171-64CNES]- Préparer un planning de mission [RVP]
CATEGORIES:TBD
DTSTART;TZID=Europe/Paris:20220628T080000
DUE;TZID=Europe/Paris:20220628T180000
DESCRIPTION:Prendre en compte :
- Délai entre la mission précédente pour la même agence (au moins 6 mois pour CNES/DLR),
- Délai avec autres missions prévues à la période considérée,
- Périodes de congés (zone C, académie de Bordeaux) et jours fériés
(http://www.education.gouv.fr/pid25058/le-calendrier-scolaire.html)
END:VTODO
BEGIN:VTODO
CREATED:20221012T182437Z
LAST-MODIFIED:20221012T182437Z
DTSTAMP:20221012T182437Z
UID:3dffcb60-b660-4f32-b256-310940b3c240
SUMMARY:[VP171-64CNES]- Réception liste des expériences présélectionnées [RM]
CATEGORIES:TBD
DTSTART;TZID=Europe/Paris:20221001T080000
DUE;TZID=Europe/Paris:20221001T180000
DESCRIPTION:RM doit faire attention au nombre d'expériences en RBM, à cause des limitations des CPP (5 dossiers / mois).
Informer le RIF pour étude de faisabilité.
END:VTODO
END:VCALENDAR
CalIcsParser.jsm:156
mail.import: Error: noItemsFound
parseIcsFile resource:///modules/CalendarFileImporter.jsm:55
_showItems chrome://messenger/content/aboutImport.js:1109
CalendarFileImporter.jsm:58:20
Uncaught (in promise) Error: noItemsFound
parseIcsFile resource:///modules/CalendarFileImporter.jsm:55
_showItems chrome://messenger/content/aboutImport.js:1109
CalendarFileImporter.jsm:55:15
Reporter | ||
Comment 1•3 years ago
|
||
Reporter | ||
Comment 2•3 years ago
|
||
Comment 3•3 years ago
|
||
ParserError: invalid line (no token ";" or ":") "Informer le RIF pour tude de faisabilit."'ParserError: invalid line (no token ";" or ":")
Indeed the description is on two lines, but the multi-line does not have the required initial space. https://www.rfc-editor.org/rfc/rfc5545#section-3.1
DESCRIPTION:RM doit faire attention au nombre d'expériences en RBM, à cause des limitations des CPP (5 dossiers / mois).
Informer le RIF pour étude de faisabilité.
END:VTODO
What did 91 do?
Reporter | ||
Comment 4•3 years ago
|
||
TB91 does the import without complaining.
Reporter | ||
Comment 5•3 years ago
|
||
Some additional tests on TB102:
- Adding a space to the 2nd line at "Description" component property works:
DESCRIPTION:RM doit faire attention au nombre d'expériences en RBM, à cause des limitations des CPP (5 dossiers / mois).
Informer le RIF pour étude de faisabilité.
- Adding adding a third line without initial space works also:
DESCRIPTION:RM doit faire attention au nombre d'expériences en RBM, à cause des limitations des CPP (5 dossiers / mois).
Informer le RIF pour étude de faisabilité.
blabla
So the bug only seems to apply only if the second line does not have the initial space.
Reporter | ||
Comment 6•3 years ago
|
||
The submitted ics file also shows some non compliance with the RFC:
- lines of text longer than 75 octets,
- lines not delimited by CRLF sequence
but the parser seems to be tolerant with discrepancies.
Would be good (but this your decision) if the parser can also be non sensitive with missing initial space as it was on TB91.
I encountered this issue. With the help of ChatGPT, I made a script to (seemingly) fix the ics that Thunderbird exported but couldn't import again. I'm sharing the workaround for everyone's convenience:
# File paths of the .ics file
$filePath = "path\to\your.ics"
$outFilePath = "path\to\your_updated.ics"
# Get the total number of lines for the progress bar
$totalLines = (Get-Content -Path $filePath | Measure-Object -Line).Lines
# Open the file for reading and writing
$reader = [System.IO.File]::OpenText($filePath)
$writer = New-Object System.IO.StreamWriter $outFilePath
$counter = 0
$isContinuation = $false
try {
while ($reader.EndOfStream -eq $false) {
$line = $reader.ReadLine()
$counter++
# Update the progress bar
Write-Progress -Activity "Updating .ics file" -Status "$counter of $totalLines lines processed" -PercentComplete (($counter/$totalLines)*100)
# If the line contains a new property, it's the start of a new property
if ($line -match '^[^:]*:') {
$isContinuation = $false
}
# If the line does not contain a new property or is not empty, we are in a continuation line
if (($line -notmatch '^[^:]*:') -or ($line -eq '')) {
$isContinuation = $true
}
# If the line is not empty or contains a new property, we are in a continuation line, and the line doesn't start with a space, add a space at the start
if (($line -ne '' -or $line -notmatch '^[^:]*:') -and ($isContinuation -eq $true) -and (!$line.StartsWith(" "))) {
$line = " " + $line
}
# Write the line (modified or not) to the new file
$writer.WriteLine($line)
}
}
finally {
$reader.Close()
$writer.Close()
}
Comment 8•2 years ago
|
||
libical was apparently more forgiving
Another sample: https://www.mytischtennis.de/community/exportICSCalendar?teamids=2702550
Comment 10•2 years ago
|
||
Comment 13•2 years ago
|
||
When trying to add an email as an calendar-event, the same error persists with latest stable versions of
- Thunderbird
- DaviCAL (self-hosted)
Description
•