Skip to content

Pre-populating a Schedule can result in incorrect entries #81

@CraigHawker

Description

@CraigHawker

Use the following configuration class structure:

[DataContract]
public class Configuration
	: ConfigurationBase
{
        [DataMember]
        [RecurringOperationConfiguration(VaultApplication.QueueId, "TaskTypeB")]
        public Schedule Schedule { get; set; } = new Schedule()
        {
            Enabled = true,
            Triggers = new List<Trigger>
                {
                    new DayOfMonthTrigger()
                    {
                        TriggerDays = new List<int> { 1 },
                        TriggerTimes = new List<TimeSpan>{ new TimeSpan(1, 0, 0) }
                    }
                }
        };
    }
}

When the application starts, the processor is scheduled for 1am on the first of the next month. This can be seen on the dashboard.
Good.

Go into the configuration editor and set up a trigger for 2am on the second of the next month. When saved, note that both the original trigger and the new one are shown as valid in the dashboard. There is no way to remove the one that was created initially.

This seems to be related to this issue whereby Newtonsoft appends the list items rather than replacing them.

As we cannot control the deserialization directly (it is done outside of this library), we probably need a custom JsonConverter to handle this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions