Skip to content
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

fixes 3326 #3338

Merged
merged 3 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions client/Packages/com.beamable.server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.19.18]
### Fixed
- `BeamScheduler` can deserialize jobs without a `source` field.
- `AssumeNewUser` does not allow `userId` that is not a positive value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems not-relevant to the current changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm, I'm bad at reading diffs. I wish GitHub had highlighted it differently.


### Changed
- `async void` methods are not allowed in Microservices, and will cause the Microservice to fail. Instead, consider using methods with `async Task`, or `async Promise`.

### Fixed
- `AssumeNewUser` does not allow `userId` that is not a positive value

## [1.19.17]
### Fixed
- Mock `Unity.Addressable` reference included in Microservice builds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public static Job Convert(JobDefinition job)
id = job.id.GetOrThrow(() => new Exception("Job definition has no id.")),
action = job.jobAction.Convert(),
triggers = job.triggers.Select(t => t.Convert()).ToList(),
source = job.source.GetOrThrow(() => new Exception("Job definition has no source")),
source = job.source.GetOrElse(() => null),
name = job.name.GetOrThrow(() => new Exception("Job definition has no name")),
owner = job.owner.GetOrThrow(() => new Exception("Job definition has no owner")),
retryPolicy = new RetryPolicy
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Beamable.Api.Autogenerated.Models;
using Beamable.Common.Content;
using Beamable.Common.Scheduler;
using NUnit.Framework;

namespace microserviceTests.CronBuilderTests;

public class JobConversionTests : CommonTest
{
[TestCase]
public void CanDeserializeJobWithoutSource()
{
var job = new JobDefinition
{
id = "test",
name = "test",
owner = "test",
source = new OptionalString(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The semantics here are that new OptionalString() with no constructor argument is an empty optional string? That is, new OptionalString() is the equivalent of Scalas None`?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct- that is a None

jobAction = new HttpCall
{
body = "test",
contentType = "test",
method = "post",
uri = "test"
},
retryPolicy = new OptionalJobRetryPolicy(new JobRetryPolicy
{
maxRetryCount = 1,
retryDelayMs = 1,
useExponentialBackoff = false
}),
triggers = new IOneOf_CronTriggerOrExactTrigger[]{}
};

var result = BeamScheduler.Utility.Convert(job);
Assert.That(result.source, Is.Null);
}
}
Loading