ialbert / biostar-central

Biostar Q&A

Home Page:http://www.biostars.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weird bug: Post is truncated

RamRS opened this issue · comments

Hi, I was trying to edit this post when I noticed something weird - half the content would disappear on clicking edit.

Before clicking edit:

before clicking edit

On clicking edit:

on clicking edit

On looking at the result of the API call, the xhtml field contains the full post content while the content field has the truncated content. The post was never edited after creation.

{
    "answer_count": 1,
    "author": "cassandratzh",
    "author_uid": "25794",
    "book_count": 0,
    "comment_count": 1,
    "content": "I tried to run the following command and got an error stating bcftools: ccall.c:237: update_bcf1: Assertion `call->unseen==nals-1' failed. Aborted (core dumped)\r\n\r\nThis is my command :",
    "creation_date": "2016-04-25T02:47:44.498492+00:00",
    "has_accepted": false,
    "id": 180699,
    "lastedit_date": "2016-04-25T02:47:44.498492+00:00",
    "lastedit_user_uid": "25794",
    "parent_id": 180699,
    "rank": 1461552464.498492,
    "reply_count": 1,
    "root_id": 180699,
    "status": "Open",
    "status_id": 1,
    "subs_count": 1,
    "tag_val": "bcftools,samtools,bioinformatics",
    "thread_score": 2,
    "title": "Error with bcftools",
    "type": "Question",
    "type_id": 0,
    "uid": "188481",
    "url": "https://www.biostars.org/p/188481/",
    "view_count": 1517,
    "vote_count": 0,
    "xhtml": "<p>I tried to run the following command and got an error stating bcftools: ccall.c:237: update_bcf1: Assertion `call-&gt;unseen==nals-1' failed. Aborted (core dumped)</p>\n\n<p>This is my command :</p>\n\n<p>samtools mpileup -C 0 -A -B -d 10000 -v -u -f hg19/hg19lite_ucsc_chrM.fa MB_1294_N_P0061.R1_sort.bam | /usr/bin/bcftools call -O v -v -c -n 0.05 -p 1 -A -o MB_1294_N_P0061.R1.vcf</p>\n\n<p>How can I solve this problem?</p>\n\n<p>Thanks!</p>\n"
}

What could be going on here?

back in the days we would allow HTML for some period of time - forgot how long, many months most likely - the site worked via a WYSIWG HTML editor (CK Editor) that would allow both Markdown and HTML input.

Alas the editor was very wonky and would allow people to insert weird HTML, especially when copy pasting from various colored terminals, webpages etc. we would end up with very annoying problems.

When the migration away from CK Editor happened, we realized that some content cannot be converted to Markdown. We ended up with the conundrum of what to do with a post that displays correctly at this time yet cannot be turned into markdown. Normally the markdown gets converted into HTML.

In those cases, the markdown does not reflect the HTML anymore and the post cannot be retained after editing anymore, whatever the original HTML is, upon editing it would lose the non-convertible parts.

I believe the site will refuse to apply the edit, at least it has some checks and attempts to discover and then forbid destroying old, non-convertible posts.

Those posts should be left alone.

I can try and recover this one but this is the only one of this kind I've encountered so far. I'll keep you posted though, maybe there's an underlying pattern to these posts.

Looks like we discussed this when it happened: https://www.biostars.org/p/191834/

I fixed the post content after this issue was resolved. I'm closing this issue now