-
Notifications
You must be signed in to change notification settings - Fork 115
Pioneer upgrade - final adjustments #1195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There is a minor merge conflict in yarn.lock after merging #1189 |
| ).map((x) => x.id); | ||
|
|
||
| const isPublicAndNotCurated = (video: VideoType) => { | ||
| const isPublic = video.publicationStatus.id === idOfPublicPS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context, while exporting state from current chain, some items were dropped and their property values were dropped. This could explain this error for some particular videos: https://github.com/Joystream/joystream-api-examples/pull/12/files#diff-6d0009198c779316ce8a37be5c378e3cR118
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the media transport needs some improvement to determine when the property values don't exist and just exclude it from the array (similarly to where we did this check entity.in_class_schema_indexes.toArray().length)
|
Changed the implementation of |
|
Fixed |
|
Just some feedback so far, as I'm still going through the PR:
Reason: In some components we grab the
rename The term "Mock" in the name is misleading but the approach is perfectly reasonable, and that is in fact how react-api initializes the Api and types registry.
I tested media app again with dropped entities work nicely and I was able to navigate and play content.
|
| return { | ||
| Component: Media, | ||
| display: { | ||
| needsApi: ['query.storageWorkingGroup.workerById', 'query.dataObjectStorageRegistry.relationshipsByContentId'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
media does need a few additional apis from other modules, should we be more comprehensive? I suppose this applies to other joy-* apps as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those are not very strict even in the original polkadot-js/apps I think.
The needsApi itself is required as it affects how components are rendered by apps/src/Content/index.tsx, but including all the methods that are actually used by given module would be hard to maintain.
It makes sense only if there are multiple chains user can connect to, which have different runtime modules.
| } else { | ||
| this.setState({ file, computingHash: true }); | ||
| this.startComputingHash(); | ||
| void this.startComputingHash(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the presence of this void here? Is it to drop or ignore the return value of the call ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a way to mark a promise which we intentionally don't await. It's required by the new no-floating-promises rule (see: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-floating-promises.md#ignorevoid)
I think it's a good rule, because it prevents omitting await by accident. Marking with void also gives a a nice hint that the function/method we execute is async.
| return; | ||
| } | ||
|
|
||
| const activeProviders = (await transport.workingGroups.allWorkers('Storage')).map(([id]) => id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this implementation we need to filter out the Storage Group Lead id, so we get only the storage providers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After raising this in chat, we can ignore this comment.
ref: #1211
| ); | ||
|
|
||
| for (const groupOpening of groupOpenings.linked_values) { | ||
| for (const [/* id */, groupOpening] of groupOpenings) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't need the key (id), which we get from value.hiring_opening_id.id, perhaps better to get .values() from map only instead of .entries(). Its a minor point, but it would give a cleaner Destructuring assignment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dind't notice .values() method to be available. We could write an implementation similar to entiresByIds, but it would actually do the same thing (execute entiresByIds and then throw away ids), since we still need ids to sort the entries (by default they are returned in unpredictable order)
| requiredApplicationStake: stakes.application, | ||
| requiredRoleStake: stakes.role, | ||
| defactoMinimumStake: new u128(0) | ||
| defactoMinimumStake: this.api.createType('u128', 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Balance instead of u128 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 728bb4c
This was an issue before the upgrade too, but fixed it now in 8b2b484
Done in c8f2d1f |


This PR contains all Pioneer upgrade changes after the
joy-memberspackage upgrade (#1156).Covered issues:
joy-election(from 5d4a194 to 9fadcaf)joy-utilsreactivation and upgrading - added transport provider for all packages that use the api (currently justmemberstransport)joy-electionand did all the necessary adjustments.polkadot-js/appscore packages (ie. allowing council election stage as sidebar tab subtitle, just like before)joy-proposals(from f7d87da to e19eb61 + 673855f)joy-utils- all transports insidejoy-utilsshould now be compatible with the new runtime and apijoy-proposalsjoy-proposalsto be typesafe (new linter rules are very strict when it comes to the use ofanytype, but this is good, since we can usually avoid that now that@joystream/typeshave been refactored)TxButtonto allow them to be used in more customizable way (introducedSemanticTxButtonandDefaultTxButton) since they lost(?) some of the customizability due to changes in@polkadot/react-componentsjoy-roles(from 17933d4 to a9e4448)joy-utilsjoy-rolesjoy-utilsto avoid unnecessary re-renders that could lead to loss of data in the forms, problems when resizing the page and generally poor UX and optimalization. The main issue was that custom "render functions" were used in a few places instead of standard React components. When those functions were called after some state update - everything that they previously rendered was getting re-rendered from scratch and all the previous state in child components was lost.anytype)jestavailable again which allows runningyarn workspace @polkadot/joy-roles test, addedgenerate:json-schemasscripting in@joystream/typesto allow updatinghiring/schemas/role.schema.json, configured webapck to handle.scssfiles, added backtsconfig-paths-webpack-pluginto allow running storybook in the future)joy-media(from 03bd123 to 83a225c)joy-mediajoy-utils(ie.withCurationActorwhich I also had to upgrade to work with the new runtime)joy-media(creating types, linked maps usages in the transports etc.)instanceofdue to mismatching versions ofbn.jsin the monorepo (fixed by adding toresolutions)instanceofdue toapi.createType('ChannelId', 1)(and some other ids) returningu64(which causedinstanceof ChannelIdto returnfalsein those cases)joy-forum(from ad0377e to 5ce833f)joy-forum+ implemented the necessary adjustmentsjoy-utilsjoy-utils(ie. allowing to specify the size, displaying council badge etc.) to prevent imports betweenjoy-membersandjoy-forum.Remaining commits (after 5ce833f)
yarn workspace pioneer storybookagain)MemoForm) which was previously part ofapp-accountsjoy-utilsmigrationold-apps,joy-utils-old)RuntimePropsaldetails by changing the type fromVec<u8>toBytes(which works the same way, but doesn't have the32768length limit)