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

Post shows edit button but trying to save the message gives "post is too old" error #315

Open
sschwarzer opened this issue Feb 20, 2022 · 6 comments · May be fixed by #316
Open

Post shows edit button but trying to save the message gives "post is too old" error #315

sschwarzer opened this issue Feb 20, 2022 · 6 comments · May be fixed by #316

Comments

@sschwarzer
Copy link

I wrote two posts in the thread https://forum.nim-lang.org/t/8927 and want to edit the second post, https://forum.nim-lang.org/t/8927#58310 . When I edit the post and try to save it I get the error message "This post is too old and can no longer be edited".

I got this message already after a few minutes after posting, and I get it now. But even if the post was too old it wouldn't make sense to show the Edit icon below the post (even when I reload the thread page now). Since posts used to be editable rather for days, I guess the ability to edit is the actually wanted behavior, but it's prevented by the error message instead of a successful submission of the edited post.

My web browser is Firefox 97.0 on Linux.

@dom96
Copy link
Contributor

dom96 commented Feb 20, 2022

The relevant code is here: https://github.com/nim-lang/nimforum/blame/master/src/forum.nim#L516.

Reading it I don't see what the cause of this could be. @narimiran any ideas?

@sschwarzer
Copy link
Author

Thanks for the quick reply! :-)

I don't know if it's relevant for reproducing the bug, but before the mentioned two posts I hadn't posted any message for over a year. Maybe there's a threshold of some kind that's not processed correctly.

@narimiran
Copy link
Member

narimiran commented Feb 21, 2022

Reading it I don't see what the cause of this could be. @narimiran any ideas?

I've taken a quick look.
I think my change of allowed time for edit didn't introduce this.

I think this code here should be changed to account for the elapsed time since posting and then don't show edit and delete buttons — fix in #316.

@sschwarzer
Copy link
Author

Thanks for the fix!

I still wonder why I couldn't edit the post anymore even after a few minutes. As far as I understand the code, the threshold is supposed to be two hours, isn't it?

@narimiran
Copy link
Member

I still wonder why I couldn't edit the post anymore even after a few minutes. As far as I understand the code, the threshold is supposed to be two hours, isn't it?

This is something I didn't experience in my using of the forum, i.e. I regularly edit my posts after I submit them.

@sschwarzer
Copy link
Author

This is something I didn't experience in my using of the forum, i.e. I regularly edit my posts after I submit them.

I believe you, but I experienced it nonetheless. :-) It seems there are additional conditions for this bug. If you don't want to invest more time in debugging this problem, I understand that, too.

Do you have any plans when to deploy the fix on https://forum.nim-lang.org ? If the new version is there, I'd tell you in case I run again into the "can't edit shortly after posting" issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants