Exporting message to HTML shifts if new arrive #589

Closed
opened 2013-12-10 13:58:11 +01:00 by MidnightLightning · 4 comments
MidnightLightning commented 2013-12-10 13:58:11 +01:00 (Migrated from github.com)

If you right-click and choose "Save Message as...", and then on the file location box if you sit and wait for a new message to come in, when you then hit save, the message that gets saved is not the one you originally clicked on, but one newer.

It seems the index offset in the list is what's grabbed and queued for export, not the message itself. That should be fixed, to ensure the message you want is actually the one you get.

Running on OSX 10.6.8

If you right-click and choose "Save Message as...", and then on the file location box if you sit and wait for a new message to come in, when you then hit save, the message that gets saved is not the one you originally clicked on, but one newer. It seems the index offset in the list is what's grabbed and queued for export, not the message itself. That should be fixed, to ensure the message you want is actually the one you get. Running on OSX 10.6.8
nimdahk commented 2013-12-11 19:54:48 +01:00 (Migrated from github.com)

The message contents are grabbed before the save dialog is shown.

        msgid = str(self.ui.tableWidgetInbox.item(
            currentInboxRow, 3).data(Qt.UserRole).toPyObject())
        queryreturn = sqlQuery(
            '''select message from inbox where msgid=?''', msgid)
        if queryreturn != []:
            for row in queryreturn:
                message, = row

        defaultFilename = "".join(x for x in subjectAtCurrentInboxRow if x.isalnum()) + '.txt'
        filename = QFileDialog.getSaveFileName(self, _translate("MainWindow","Save As..."), defaultFilename, "Text files (*.txt);;All files (*.*)")
            f = open(filename, 'w')
            f.write(message)

https://github.com/Bitmessage/PyBitmessage/blob/master/src/bitmessageqt/init.py#L2655

The message contents are grabbed before the save dialog is shown. ``` msgid = str(self.ui.tableWidgetInbox.item( currentInboxRow, 3).data(Qt.UserRole).toPyObject()) queryreturn = sqlQuery( '''select message from inbox where msgid=?''', msgid) if queryreturn != []: for row in queryreturn: message, = row defaultFilename = "".join(x for x in subjectAtCurrentInboxRow if x.isalnum()) + '.txt' filename = QFileDialog.getSaveFileName(self, _translate("MainWindow","Save As..."), defaultFilename, "Text files (*.txt);;All files (*.*)") ``` ``` f = open(filename, 'w') f.write(message) ``` https://github.com/Bitmessage/PyBitmessage/blob/master/src/bitmessageqt/__init__.py#L2655
MidnightLightning commented 2013-12-12 21:10:37 +01:00 (Migrated from github.com)

Huh, maybe I was mis-clicking; I'll give it another try and see if it was user error!

Huh, maybe I was mis-clicking; I'll give it another try and see if it was user error!
MidnightLightning commented 2013-12-13 03:50:07 +01:00 (Migrated from github.com)

It is still an issue; when I right click a message and choose "Save as..." I get the proper subject auto-filled as the filename, but the body can be overwritten if more messages come in while the dialog is open. I wonder if the message variable get clobbered while the open dialog is open, so it writes the wrong message in the file?

It is still an issue; when I right click a message and choose "Save as..." I get the proper subject auto-filled as the filename, but the body can be overwritten if more messages come in while the dialog is open. I wonder if the `message` variable get clobbered while the open dialog is open, so it writes the wrong message in the file?
PeterSurda commented 2015-12-16 22:54:11 +01:00 (Migrated from github.com)

I can't reproduce this (OSX 10.11.2).

I can't reproduce this (OSX 10.11.2).
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Bitmessage/PyBitmessage-2025-02-27#589
No description provided.