Joystream / joystream

Joystream Monorepo
http://www.joystream.org
GNU General Public License v3.0
1.42k stars 115 forks source link

[Content curation working group] Opening immediately deactivated when entering review period #127

Open yourheropaul opened 4 years ago

yourheropaul commented 4 years ago

Note: this was replicated using PR #103, which may be outdated. All calls are assumed to be via polkadot.js via Pioneer

Problem

When I begin the applicant review for an opening, the opening is immediately deactivated.

Steps to reproduce

  1. Create a new curator opening. I'm setting it active at the current block, with a max review length of 99999, rationing policy of max_active_applicants: 10. There are no required stakes. This extrnsic is resolved successfully.
  2. (optional) Make a curator application. The application is stored properly, and recorded against both the Opening and the CuratorOpening.
  3. Call begin_curation_applicant_review, passing the ID of the opening created in step 1. This extrnsic is resolved successfully.
  4. Check the status of the opening; it is deactivated. Example status dump from polkadot:

screenshot

What I should see

The opening should be in a review state, not a deactivated state.

Analysis

Deactivation cause 3 seems to be review period expired... but as far as I can tell, the review period has not expired.

┆Issue is synchronized with this Asana task by Unito

yourheropaul commented 4 years ago

Addendum to this:

I noticed that, when the opening is deactivated, the application stage is incorrect. See this screenshot:

image

I don't think they should be a WaitingToBegin state.

mnaamani commented 4 years ago

I think the testcase begin_curator_applicant_review_success() covers this issue. I added one assertion to it as well, and it seems to be correct. So maybe this has been fixed (referencing that is was tested against older runtime at the top of this issue)

mnaamani commented 4 years ago

Confirming I see the same issue when testing the via extrinsics.

mnaamani commented 4 years ago

This suggests some bug in on_finalize logic, since there isn't any in the working group its like in the hiring module. https://github.com/Joystream/substrate-hiring-module/pull/20 contains a reference to a fix in on_finalize(review period).. will test

mnaamani commented 4 years ago

Indeed that fix in the hiring module resolves this issue, this is the state of the Opening after calling begin_curator_applicant_review() -> ReviewPeriod as expected.

{"created":13,"stage":{"Active":{"stage":{"ReviewPeriod":{"started_accepting_applicants_at_block":13,"started_review_period_at_block":16}},"applications_added":[],"active_application_count":0,"unstaking_application_count":0,"deactivated_application_count":0}},"max_review_period_length":9999,"application_rationing_policy":null,"application_staking_policy":null,"role_staking_policy":null,"human_readable_text":"First Curator Opening"}

The fix however does seem to break some tests for the working group https://github.com/Joystream/substrate-runtime-joystream/pull/134