Merged
Conversation
Due to what is seemingly an issue with the Spine core the `MirrorProjection` messages can be delivered only within a single `BoundedContext` - the one which is registered last. So the "main" bounded context, where the multitenant tests run and multiple aggregates are read, is now registered last and the "auxiliary" single-tenant context will contain a `UserInfo` aggregate and a corresponding projection instead of having a single visible aggregate. Also fixed how the `observe`d event is handled in the single-tenant tests.
Also documented the tenant-related classes.
...to avoid skipping versions `1.5.4`-`1.5.10` of Spine `web`. The `base` and `core` dependencies remain `1.5.11` and `1.5.10` correspondingly.
Codecov Report
@@ Coverage Diff @@
## master #141 +/- ##
============================================
+ Coverage 62.00% 62.14% +0.13%
Complexity 178 178
============================================
Files 86 87 +1
Lines 2116 2174 +58
Branches 38 38
============================================
+ Hits 1312 1351 +39
- Misses 795 814 +19
Partials 9 9 |
Contributor
Author
|
@armiol, @dmdashenkov PTAL. |
dmdashenkov
suggested changes
May 4, 2020
| * @param {!string} tenantIdValue the tenant ID | ||
| * @return {TenantId} a new `TenantId` instance | ||
| */ | ||
| static plainString(tenantIdValue) { |
Contributor
There was a problem hiding this comment.
Let's have convenience methods for other types of TennantIds as well.
client-js/main/client/tenant.js
Outdated
| } | ||
| } | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
Please remove the empty line.
client-js/package.json
Outdated
| { | ||
| "name": "spine-web", | ||
| "version": "1.5.3", | ||
| "version": "1.5.11", |
Contributor
There was a problem hiding this comment.
Please keep in sync this version and the version quoted in the PR description.
| import io.spine.core.UserId; | ||
| import io.spine.server.aggregate.AggregateRepository; | ||
|
|
||
| class UserInfoRepository extends AggregateRepository<UserId, UserInfoAggregate> { |
Contributor
There was a problem hiding this comment.
Suggested change
| class UserInfoRepository extends AggregateRepository<UserId, UserInfoAggregate> { | |
| final class UserInfoRepository extends AggregateRepository<UserId, UserInfoAggregate> { |
| import io.spine.core.UserId; | ||
| import io.spine.server.projection.ProjectionRepository; | ||
|
|
||
| class UserInfoViewRepository |
Contributor
There was a problem hiding this comment.
Suggested change
| class UserInfoViewRepository | |
| final class UserInfoViewRepository |
Contributor
Author
|
@dmdashenkov PTAL again. |
dmdashenkov
approved these changes
May 5, 2020
Contributor
dmdashenkov
left a comment
There was a problem hiding this comment.
LGTM with a couple of comments to discuss.
| import io.spine.core.UserId; | ||
| import io.spine.server.aggregate.AggregateRepository; | ||
|
|
||
| final class UserInfoRepository extends AggregateRepository<UserId, UserInfoAggregate> { |
Contributor
There was a problem hiding this comment.
Please check if you can use the default repository instead of explicitly declaring one.
| import io.spine.core.UserId; | ||
| import io.spine.server.projection.ProjectionRepository; | ||
|
|
||
| final class UserInfoViewRepository |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the multitenancy support to the JS client.
The
Clientfactory API now accepts aTenantProvideras a part of the passed client options.The
TenantProviderdefines the current tenant ID to be used for all requests done with the client.The current tenant ID can be dynamically updated with the help of
TenantProvider.update(TenantId).For single-tenant applications, the
TenantProvidercan be omitted in the options.Spine web version advances to
1.5.4.