Commit Graph

20 Commits

Author SHA1 Message Date
James Williams 3563a465b3 don't regenerate stream item instances after message deletion
just regenerate the data stored on the stream item itself

test plan:
* send a message to two other users
* as one user, hide the conversation stream item
on the dashboard
* as the other, delete the message in the inbox
* the stream item should not have reappeared

closes #COMMS-1812

Change-Id: I9338c56bb5c26d3585452879b83dee5c64a497bb
Reviewed-on: https://gerrit.instructure.com/175996
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Steven Burnett <sburnett@instructure.com>
2018-12-20 05:52:35 +00:00
Sara Chadwick fc16a5fb90 Change Activity Stream API to contain missing attributes
Fixes COMMS-1139

Test Plan:
- Send a new conversation to your main user
- Using https://lti-tool-provider-example.herokuapp.com/xml_builder,
  create a new collaboration. Set the collaboration section to
  content_item_selection_request
- Go to http://localhost:3000/api/v1/users/self/activity_stream and
  verify that the message for the collaboration object is the collab's
  description.
- Also verify that the title of the conversation object is the subject

Change-Id: If1fecd634ecf3e3af89055b5e0f958c83f419d27
Reviewed-on: https://gerrit.instructure.com/155673
Tested-by: Jenkins
Reviewed-by: Landon Gilbert-Bland <lbland@instructure.com>
QA-Review: Steven Burnett <sburnett@instructure.com>
Product-Review: Sara Chadwick <schadwick@instructure.com>
2018-06-29 17:07:21 +00:00
Cody Cutrer 610751f33a vacuum stream_items an stream_item_instances after cleaning them up
also do it 4x daily rather than 1x daily

Change-Id: I328091586226e334c48bfe96b57b0a601bb22ef2
Reviewed-on: https://gerrit.instructure.com/143678
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2018-03-22 21:56:36 +00:00
Dan Minkevitch 8e72341fb0 Revert "fix differentiated assignments discussion stream items"
This reverts commit 2446326f02.

Change-Id: Ia8eeef32328a0abbcf890e0058c1a77d8563d247
Reviewed-on: https://gerrit.instructure.com/137136
Reviewed-by: Steven Burnett <sburnett@instructure.com>
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Rob Orton <rob@instructure.com>
2018-01-06 18:51:51 +00:00
James Williams 45ddbd2d0e clear cached context short names after update
test plan:
* add a rubric to a course
* update the course's course code
* use the "find rubric" to add an existing
 rubric to an assignment
* the course code listed on the left side
 should match the new course code

closes #OUT-1781

Change-Id: Iebc77716ecfef90ae9e099367c2305314dbf265e
Reviewed-on: https://gerrit.instructure.com/136576
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Andrew Porter <hporter-c@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2018-01-02 19:29:47 +00:00
Felix Milea-Ciobanu 2446326f02 fix differentiated assignments discussion stream items
fixes COMMS-246 COMMS-500

test plan:
- create a graded discussion in a course with at least two students
- post in the discussion as the teacher
- without viewing the notification, check the dashboard as each of the
  students and make sure each have 1 discussion notification
- as the teacher, assign that discussion only to the first student
- as the first student check your dashboard and note you still have
  that notification
- as the second student check your dashboard and note you no longer
  see that discussion notification or the discussion itself
- as the teacher make another reply on that discussion
- as the second student note that you don't see a new discussion
  notification or the discussion itself on the dashboard

Change-Id: If5af3878d9e995479b959d799f6ebd7e82a1d14a
Reviewed-on: https://gerrit.instructure.com/132037
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Venk Natarajan <vnatarajan@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Felix Milea-Ciobanu <fmileaciobanu@instructure.com>
2017-11-21 20:07:20 +00:00
Landon Wilkins 242581edd3 da licença part 48
add consistent license headers to all source files

Change-Id: Ib581cddb21430cf4971aeb14980727c2935e31e4
Reviewed-on: https://gerrit.instructure.com/110154
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-04-28 18:59:33 +00:00
Simon Williams ece65b5a89 spec: rename the `user` helper to `user_factory`
closes CNVS-34042

test plan: specs should pass

Change-Id: I20709a69f0cb28fb55eba18ca81f89f4d7673b56
Reviewed-on: https://gerrit.instructure.com/98426
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-12-27 20:25:25 +00:00
Cody Cutrer 43c561d2d3 rip out more polymorphic shims
Change-Id: Ie93eb06d746aa2f6968b0e29e1d22dfb2242c12f
Reviewed-on: https://gerrit.instructure.com/69683
Tested-by: Jenkins
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2016-01-11 17:40:03 +00:00
Cody Cutrer 912a2cb083 rspec 3-ify spec/models
refs CNVS-16239

Change-Id: I0dc5ac9cb86fbb5dd0335d9e21d77d4a48ecb774
Reviewed-on: https://gerrit.instructure.com/42697
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2014-10-14 20:10:03 +00:00
Joel Hough 1c31aee79c stop stream items from unlinking discussion subentries
fixes CNVS-14383

test plan
- create a discussion with "post before seeing replies" checked
- create a reply to the discussion
- as a user in the course who has not replied to the topic,
 fetch the /api/v1/courses/:course_id/activity_stream/summary
- as the topic creator, edit the topic message (to queue a job
 to recreate the materialized view)
- ensure that the reply is still present (the materialized view
 must be regenerated before the bug would remove the entry)
- toggle the unread state on the entry, ensuring that no errors
 appear in the debug console

Change-Id: Iaf8d15195c5c6fef8f1b22bf7dfc9110b05394f2
Reviewed-on: https://gerrit.instructure.com/38564
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
2014-08-01 20:11:42 +00:00
Cameron Matheson 3c434e8aff Remove unused collections stuff
This was a beta api that didn't work out.

Test plan:
  canvas should still work (sorry, this touches lots of stuff)

Change-Id: I31680b83f72f6d739ce74735ba40d7a760debb33
Reviewed-on: https://gerrit.instructure.com/29506
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2014-02-07 19:32:46 +00:00
Jon Jensen e6870fce02 fix cross-shard stream item dismissal, fixes CNVS-1404
1. make sure the returned stream item ids are relative to the user, not
   the domain, since we need to look up the instances by those ids from
   the user's shard later
2. make sure we actually handle shortened global ids, rather than
   asploding
3. just cache stream items on the user's shard, not on every shard the
   user visits. makes cache invalidation practical/possible

test plan:
1. set up canvas with redis and sharding
2. set up two additional shards (your user is in the initial/primary one)
3. enroll your user in a course in the second shard
4. as another user, do something that creates a stream item for the course
   (e.g. create an announcement)
5. as the original user, confirm that:
   1. you see the stream item on your shard's dashboard
   2. you can dismiss the stream item
   3. when you refresh the page, it is still dismissed
6. repeat step 4.
7. as the original user, confirm that:
   1. you can see the stream item on the shard 3 dashboard
   2. you can dismiss the stream item
   3. when you refresh the page, it is still dismissed
8. as the original user, confirm that the items are dismissed from your
   dashboard on all shards

Change-Id: I2c600685015640af36d9e33ac71e25cd536d7391
Reviewed-on: https://gerrit.instructure.com/24155
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
2013-09-18 15:32:36 +00:00
Brian Palmer f5b017a259 spec: fix sharding it_should_behave_like for rspec 2
Apparently the fact that a shared example group added its before/after
filters to the outer context was a bug, and it's been fixed in rspec 2.
So we can't use a shared example group to setup or mark pending sharding
specs anymore.

test plan: specs

Change-Id: I92b022e2e7125214e6bad38bf0a23da547fca984
Reviewed-on: https://gerrit.instructure.com/19182
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-04-01 15:26:44 +00:00
Cody Cutrer 6dbb42e4da arel-ify specs
refs CNVS-4707

Change-Id: I3b559e6c80d817760e78df47d6c1d7c88f464f2b
Reviewed-on: https://gerrit.instructure.com/18984
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-03-27 21:51:21 +00:00
Cody Cutrer bdbeeb992d cross shard dashboards
two major pieces:
 * use context_type/context_id instead of context_code for
   three relations so that sharding extensions will
   automatically work
 * deserialize stream item data as actual AR objects instead
   of OpenObject (for similar reasons)

test plan:
 * run the predeploy migration, but not the postdeploy one
 * view your dashboard on a shard other than your home shard;
   it should be identical to your home shard
 * view courses that you are enrolled in with the same id but on
   different shards. the activity stream should have the correct
   data for the course in that shard, for both courses (i.e.
   no mixing of data from the two shards)
 * do actions that generate new stream items, and verify the new
   items appear correctly for the above two steps
 * run the postdeploy migration, wait for the job to finish, then
   repeat the test plan

Change-Id: I8d5fcadb8d971acf7388a12e9151a3e927751f44
Reviewed-on: https://gerrit.instructure.com/15462
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-11-29 17:36:24 -07:00
Simon Williams 0047480574 correctly schedule stream item cleanup job
fixes #11087

test plan:
- manually run StreamItem.destroy_stream_items_using_setting
- it should work
- you should not have stream items over a month old (you might be able to see
  this on a user that hasn't had any activity in the last month)

Change-Id: I64ae4458d18295537daeaf08cd131aea4d01091b
Reviewed-on: https://gerrit.instructure.com/14131
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-10-04 10:45:41 -06:00
Brian Palmer 9be4a8edea improve cross-shard collection item and activity stream support
Create upvotes in the upvoting user's shard, so we can query for them,
and make the upvote_count and post_count cached counts update properly
cross-shard.

Remove a foreign key constraint that was preventing users on other
shards from posting items to a collection.

Create stream_item_instances on the user's shard, and make sure to query
them from there.

Further work should be done to optimize :include so that we can
efficient pull in the stream items for the instances.

test plan: as a user on one shard, interact with a collection on another
shard -- posting to it, upvoting/downvoting, cloning items from that and
other shards. verify you don't get errors, missing data, or incorrect
counts.

Change-Id: I91aeebd404cd20663a533b2f38c08ec90c65868e
Reviewed-on: https://gerrit.instructure.com/11228
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-06-07 14:31:45 -06:00
Brian Palmer 5b04db4372 fix notifications showing up in course streams
They weren't using the course/group for the context_code, so they would
only show up in the global stream.

Note this doesn't fix existing stream items, just new ones going
forward.

test plan: add an assignment or generate any other sort of notification
that gets sent to the stream. verify that it shows up both on the
dashboard and on the individual course/group stream.

Change-Id: Icfa1430545e80c575c76960a7267ae1d7d8ddad4
Reviewed-on: https://gerrit.instructure.com/10842
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-17 14:47:28 -06:00
Cody Cutrer b92c17f11d don't infer the current user for nil DiscussionTopic#user in the stream
fixes #8403

test plan:
 * import an external content package with discussion topics
 * make sure to find a discussion topic that has no author
 * on the dashboard of a user that has a stream item about that topic
   it should not show that the current user is the author

Change-Id: I681be31462a82591d60665dce967aa1548ef3a07
Reviewed-on: https://gerrit.instructure.com/10579
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-05-08 12:55:24 -06:00