fixes CNVS-10341
test plan:
* before applying this commit, if possible:
* create a discussion
* add a reply as a student
* after applying this commit:
* open the discussion as the student
* verify that you can edit the reply you added before, but not
those from other users
* add a new reply
* without refreshing, verify that you can edit your new reply
* refresh the page
* verify that you can still edit your reply
* test basic canvas functionality (sorry)
Change-Id: Ifa654f7d853fd167d5bfbaee6184657209d58272
Reviewed-on: https://gerrit.instructure.com/28413
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
refs CNVS-9166
include Rails.application.routes.url_helpers instead
(in most of these, should be refactored to not include those either, but
not going down that rabbit hole in this commit.)
Change-Id: I3a7091ac604c811d9b7ad2777c289fc8c6477822
test-plan: N/A
Reviewed-on: https://gerrit.instructure.com/25725
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
fixes CNVS-8744
test plan:
* open a discussions thread
* open the API call for the thread in another tab
(e.g. /api/v1/courses/2/discussion_topics/1/view?include_new_entries=1 )
* post a reply to the thread and immediately refresh your API call
(within 10 seconds)
* verify that your reply is added to "new_entries" in the JSON response
* wait thirty seconds and refresh your API call again
* verify that your reply is now present in "view" with the other entries
Change-Id: If030627f0ee19a561ac9d513ca22abf609c72e87
Reviewed-on: https://gerrit.instructure.com/25517
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
i.e. don't use find_each with an order outside of a transaction
test plan:
* through pgbouncer
* with jobs running
* create a new discussion topic, and access it
* it should not seem to hang
Change-Id: I1f83497fe482246520c0858f638218e895dfb9c7
Reviewed-on: https://gerrit.instructure.com/23077
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
fixes #CNVS-1554
test plan:
* discussions should still work
Change-Id: I11e07e25c8e456e68acda519bcd412e9b25633f9
Reviewed-on: https://gerrit.instructure.com/16748
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Fixes a race condition where the view might get generated by the job
without the new entry.
test plan: this is difficult to duplicate by hand, but you could put a
breakpoint in and verify the job doesn't get inserted before the
transaction commits.
Change-Id: I6c373553dfae409adab25dd9e3bafc7126169231
Reviewed-on: https://gerrit.instructure.com/9710
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
consumers can use this to update the view client-side and ensure it's
always up-to-date even if the view is behind.
Change-Id: I1ff0cd80a758a113f8881ef74de78cc28e2fa16b
Reviewed-on: https://gerrit.instructure.com/9717
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
test plan: pull a materialized view from the /view api (making sure it
was generated with this changeset), verify you get the message back
rather than the summary
Change-Id: Ifd61218d40c67f43b85ed0171f3b90f8a20dd291
Reviewed-on: https://gerrit.instructure.com/9632
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
test plan:
load a discussion that has entries with attachments, verify you don't
get an error and you can download the attachments
Change-Id: Ibd6f28cd936d85692dff1495870b2ebb69336b70
Reviewed-on: https://gerrit.instructure.com/9616
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
Tested-by: Zach Wily <zach@instructure.com>
This is a cached-in-the-db view of the topic view json response, and
serialized arrays of participant ids and entry ids (for determining
unread entries). This is an optimization to make loading topics fast and
avoid a lot of db traffic.
test plan:
The UI for this new API is still under development, so this needs to
be tested via the API. With jobs turned off, hit the discussion view
endpoint and verify the 503 response. Then run the job to generate the
view, and verify the response json. Verify that any change to the
discussion that requires updating the view, properly updates the view.
Change-Id: I1eacace438a75a41b8b85ce6c42bfd042f27d1ea
Reviewed-on: https://gerrit.instructure.com/9443
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>