Skip to content
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

New note contains garbage text #207

Open
vanillajonathan opened this issue Nov 13, 2024 · 9 comments
Open

New note contains garbage text #207

vanillajonathan opened this issue Nov 13, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@vanillajonathan
Copy link

When I create a new note it creates a new empty file but the FolioEditView widget shows it as if it contains some garbage characters; it shows "Q�F;x".

Version: Folio 24.13 (Flatpak)

@toolstack
Copy link
Owner

I have seen this before but haven't yet been able to reproduce it consistently.

@toolstack toolstack added the bug Something isn't working label Nov 13, 2024
@toolstack toolstack added this to the Next release milestone Nov 13, 2024
@vanillajonathan
Copy link
Author

With GTK Inspector I can see that the GtkMarkdownBuffer have a property named text defined at GtkTextBuffer of type gchararray and the value of the property contains that garbage.

Maybe this is some kind of pointer to uninitialized memory? Maybe because the property current_buffer is nullable and haven't been initialized?

@toolstack
Copy link
Owner

I don't think so, I actually think it has to do with the code that ensures there is a blank line at the end of a markdown file.

Can you try creating a txt file instead of a md and see if you still see the garbage?

@vanillajonathan
Copy link
Author

Today it seems to work fine and I cannot reproduce this issue.

@toolstack
Copy link
Owner

Ok, I'll leave this open for tracking purposes.

If you can get it to reproduce and try the text file creation, let me know.

@bellegarde-c
Copy link

Not sure if it can be related, but here, every new note will fail to save anything until I restart the application.

@bellegarde-c
Copy link

Ok, looks like it's the same bug :) Garbage is shown with empty files.

Capture.video.du.2024-12-21.13-35-50.webm

@bellegarde-c
Copy link

bellegarde-c commented Dec 21, 2024

I see these errors when creating a new notebook and then a new note:


(com.toolstack.Folio:2): Gtk-CRITICAL **: 13:48:11.222: gtk_text_buffer_emit_insert: assertion 'g_utf8_validate (text, len, NULL)' failed
(com.toolstack.Folio:2): Gtk-WARNING **: 13:46:33.745: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/paintables/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators
Folio-Message: 13:46:35.221: window.vala:373: saving

@toolstack
Copy link
Owner

Those are because one or more of the text iterators have become invalid, something I do intend on tacking down at some point, but not related to this issue.

@bellegarde-c Can you get the issue to occur consitantly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants