From 0bbf3c68f62f094ffdc91d6906085f16de6519c5 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 10 Dec 2018 19:26:21 +0000 Subject: [PATCH] --- devdocs/todo.txt | 31 +++++++++++++++++++ .../AyaNova/biz/FilterSqlCriteriaBuilder.cs | 2 +- test/raven-integration/util.cs | 4 +-- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/devdocs/todo.txt b/devdocs/todo.txt index 437ce5cf..ad23005c 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -187,6 +187,37 @@ SERVER DEVOPS VERSION: 2018-12-10 16:46:25.5657|INFO|WidgetBiz::GetManyAsync|SELECT *, xmin FROM AWIDGET where name Like 'DateTokenNextMonthFilterWorks%' AND startdate >'2018-12-31T23:59:59.0000000Z' AND startdate <'2019-02-01T00:00:00.0000000Z' 2018-12-10 16:46:25.5733|WARN|Microsoft.EntityFrameworkCore.Query|Query: '(from Widget _4 in DbSet select [_4]).Skip(__p_1).Take(__p_2)' uses a row limiting operation (Skip/Take) without OrderBy which may lead to unpredictable results. + +//AFTER UPDATE +2018-12-10 19:17:47.3300|INFO|WidgetBiz::GetManyAsync|Filter criteria: +2018-12-10 19:17:47.3300|INFO|WidgetBiz::GetManyAsync|[ + + { + + "fld": "name", + + "op": "%-", + + "value": "DateTokenNextMonthFilterWorks" + + }, + + { + + "fld": "startdate", + + "op": "=", + + "value": "{[nextmonth]}" + + } + +] +2018-12-10 19:17:47.3300|INFO|WidgetBiz::GetManyAsync|Generated SQL: +2018-12-10 19:17:47.3300|INFO|WidgetBiz::GetManyAsync|SELECT *, xmin FROM AWIDGET where name Like 'DateTokenNextMonthFilterWorks%' AND startdate >'2018-12-31T23:59:59.0000000Z' AND startdate <'2019-02-01T00:00:00.0000000Z' + + + WHAT IS HAPPENING what is happening is that the data is converted to UTC before sending to the server, the server is supposed to be a dumb date unaware repository However if I want "next month" then that's relative to my personal location, I can't go by the server's next month because that is in UTC and I'm not. diff --git a/server/AyaNova/biz/FilterSqlCriteriaBuilder.cs b/server/AyaNova/biz/FilterSqlCriteriaBuilder.cs index 178c6529..358f821e 100644 --- a/server/AyaNova/biz/FilterSqlCriteriaBuilder.cs +++ b/server/AyaNova/biz/FilterSqlCriteriaBuilder.cs @@ -288,7 +288,7 @@ namespace AyaNova.Biz //Fetch useroptions object and relative time offset AyaNova.Models.AyContext ct = AyaNova.Util.ServiceProviderProvider.DBContext; var u = ct.User.AsNoTracking().Where(a => a.Id == userId).Select(m => new { tz = m.UserOptions.TimeZoneOffset }).First(); - RelativeToday.AddHours((double)u.tz); + RelativeToday=RelativeToday.AddHours((double)u.tz); #region Build criteria for date RANGE TOKEN specified //Used as the basis point diff --git a/test/raven-integration/util.cs b/test/raven-integration/util.cs index 637adb25..64e73df1 100644 --- a/test/raven-integration/util.cs +++ b/test/raven-integration/util.cs @@ -12,8 +12,8 @@ namespace raven_integration { private static HttpClient client { get; } = new HttpClient(); - // private static string API_BASE_URL = "http://localhost:7575/api/v8.0/"; - private static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/"; + private static string API_BASE_URL = "http://localhost:7575/api/v8.0/"; + // private static string API_BASE_URL = "https://test.helloayanova.com/api/v8.0/"; public static string TEST_DATA_FOLDER = @"..\..\..\testdata\";