Opened 6 years ago
Closed 6 years ago
#1773 closed defect (fixed)
RDF read from disk works once, fails after [patch]
| Reported by: | fbennett | Owned by: | dstillman |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | data layer | Version: | 2.1 |
| Keywords: | Cc: |
Description
During testing of a translator, I found that I could read an RDF file from disk once once; subsequent attempts failed, with an error that seemed to indicate that the stream was no longer available.
I'm not sure whether the attached patch is the right fix, but it gets things going, and might be a starting point for identifying exactly what the failure is.
Attachments (2)
Change History (9)
Changed 6 years ago by fbennett
comment:1 Changed 6 years ago by simon
comment:2 Changed 6 years ago by simon
That code block should read
var io = new Zotero.Translate.IO.Read(someNsIFile, "rdf");
io.reset("block");
io.reset("rdf");
io.reset("block");
comment:3 Changed 6 years ago by fbennett
I'll check whether r7879 resolved this, and get back.
comment:4 Changed 6 years ago by simon
comment:5 Changed 6 years ago by simon
comment:6 Changed 6 years ago by fbennett
I did check with r7879 applied, and go the failure but didn't get around to writing it up. With r7946, the import goes through to completion without error. There's an odd effect with the content of the popup menu clearing, but then not being destroyed for a time. Not sure if it's related to this patch, and it's a cosmetic thing that doesn't interfere with the import, but I'm putting up a screenshot for reference just in case.
Changed 6 years ago by fbennett
Lingering empty panel at start of file import, patch applied to Z2.1b5 xpi.
comment:7 Changed 6 years ago by simon
- Resolution set to fixed
- Status changed from new to closed
Fixed. I think I may also have fixed the UI issue in r8088, but if not, feel free to create a new ticket for it.
I would guess that this is caused by nsIDOMParser.parseFromStream() closing the stream when it's done with it, but I can't actually reproduce the bug. Is:
var io = new Zotero.Translate.IO.Read(someNsIFile, "rdf");
io.reset("block");
io.reset("rdf");
io.reset("block");
sufficient to reproduce this on your end, or is there something else I need to do?