Skip to content

Passages fail to load #681

@edeustace

Description

@edeustace

On production we were getting lots of errors when attempting to load:
/v2/player/player/session/598b157ae4b0f02645c1b090/passages/9243.html

The item id for this session is: 5902f10722615551ebf0c866:0.

playerDefinition.xhtml:

<div class=\"item-body qti\"> 
<stylesheet href=\"styles/export_package_cc_ela_teacher_grade-8.css\" type=\"text/css\"></stylesheet> 
<div>  
<div class=\"passage\"></div>
  <div class=\"passage\"></div> 
</div> 
 <div style=\"\">   <object type=\"text/html\" data=\"passages/9249.html\"></object>  </div> 
 <div style=\"\">   <object type=\"text/html\" data=\"passages/9243.html\"></object>  </div>  
<div>  Select whether each detail appears in &quot;Paul Revere's Ride,&quot; &quot;Paul Revere,&quot; or both. </div>  
<p class=\"prompt\"></p>
 <corespring-match id=\"RESPONSE\"></corespring-match> 
</div>

This item stores the passages (9249.html and 9243.html) in S3 and as a virtual file in mongo:

{
 "_t" : "org.corespring.platform.core.models.item.resource.VirtualFile",
  "contentType" : "text/html",
  "name" : "9243.html",
   "content": ".."
},
 {
   "_t" : "org.corespring.platform.core.models.item.resource.VirtualFile",
   "contentType" : "text/html",
   "name" : "9249.html",
   "isMain" : false,
   "content": "..."
}

the markup is stored in s3 like so:

aws s3api head-object --bucket corespring-assets-staging --key 5902f10722615551ebf0c866/0/data/9243.html
{
    "AcceptRanges": "bytes",
    "ContentType": "application/octet-stream",
    "LastModified": "Mon, 05 Jun 2017 12:22:01 GMT",
    "ContentLength": 12254,
    "ETag": "\"e37efd25b16527cd41c4f9a828e048e7\"",
    "Metadata": {}
}

So there are alot of problems with the above:

  1. The player tries to load passages/$name.html but the passage is stored at $name.html - either playerDefinition.xhtml is wrong or the passages are stored in the wrong location.
  2. The passages appear to be stored both in mongo and on S3.
  3. When stored on S3 the ContentType is application/octet-stream which won't render correctly in a browser, the ContentType needs to be text/html
  4. The structure in playerDefinition.xhtml looks broken, we have <div class="passage></div> then underneath we have an `. My guess is that these objects tags should ben inside the divs which are linked to an angular js directive.
  5. When loading a file from the player it only appears to check s3, it doesn't look at virtual files - is that correct?

Where are these items from

https://gist.github.com/edeustace/97a39acc6d848b361ce2fa25a23d246d

Progress Testing 1470
Rainforest Samples 1
Progress Testing (old) 490

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions