<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: FeatureLayer.historicMoment is ignored when applied several times in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1052036#M72772</link>
    <description>&lt;P&gt;Thank you so much for the reproducible case. It was really easy to set it up with our test service. So I was able to reproduce the problem you described. As you have described, api queries are not honoring the FeatureLayer.historicMoment after its initial settings. Subsequent queries are being made with the initial historic moment. I have created an issue for this and do not have a workaround for this. I will be sure to update you once we fix the issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for bringing this issue to our attention.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;</description>
    <pubDate>Tue, 27 Apr 2021 23:47:50 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2021-04-27T23:47:50Z</dc:date>
    <item>
      <title>FeatureLayer.historicMoment is ignored when applied several times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1051281#M72734</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;We've encountered an issue when upgrading our solution from API 4.16 to 4.19.&lt;/P&gt;&lt;P&gt;When editing a utility network feature layer (therefore branch versioned), we do use the historicMoment property feature layers to reflect the user edit stack (edits, undo/redos, commit or cancel).&lt;BR /&gt;At 4.16 this was working like a charm.&lt;BR /&gt;At 4.19 (and I tried also 4.17 and 4.18), the property setting is ignored after the first update. The first update (from undefined to a Date) is acknowledged, all subsequent updates to historicMoment are just ignored when the layer is querying the server.&lt;/P&gt;&lt;P&gt;Is anyone having the same issue ? Is there any other other workflow to make sure a FeatureLayer is correctly reading the updated branch moment ?&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Example:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Phase 1: New version, default moment. Layer is querying server without mentioning historicMoment&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Phase 2: layer.historicMoment = 1619437065322. Layer is querying server with updated historicMoment&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Phase 3: layer.historicMoment = 1619437085523. Layer keeps querying server with old previous historicMoment.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 12:58:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1051281#M72734</guid>
      <dc:creator>Frédéric_ALBERT</dc:creator>
      <dc:date>2021-04-26T12:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.historicMoment is ignored when applied several times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1051424#M72748</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;Is it possible for you post how and when you are setting your historicMoment parameters? Basically I am looking for a code snippet where I can reproduce the behavior you are running into so that we can fix the issue.&lt;/P&gt;&lt;P&gt;I just ran a very simple test and seems like historic moments are being honored.&amp;nbsp;In this example, I am starting with a specified historic moment and is working.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var featureLayer = new FeatureLayer({
  url: "serviceUrl",
  outFields: ["*"],
  gdbVersion: "yourVersion",
  historicMoment: new Date(1619458348280)
});

featureLayer.on("edits", function(result){
  console.log("edit result", result);
  var query = featureLayer.createQuery();
  console.log("query", query.historicMoment, featureLayer.historicMoment);
  featureLayer.queryFeatureCount().then(function(results){
   console.log("query", results)
  });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Thanks,&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 18:03:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1051424#M72748</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-04-26T18:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.historicMoment is ignored when applied several times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1051672#M72752</link>
      <description>&lt;P&gt;I got you a &lt;A href="https://codepen.io/fredalbert/pen/NWrBYXM" target="_blank" rel="noopener"&gt;codepen&lt;/A&gt; ready to reproduce the issue:&lt;/P&gt;&lt;P&gt;Unfortunately my server is internal, so you'll have to change some url and template to have it working.&lt;BR /&gt;It works with a branch versionned feature point layer.&lt;BR /&gt;The workflow is the following:&lt;/P&gt;&lt;P&gt;Load the map and the branch versionned feature layer&lt;BR /&gt;Collect guids regarding edited and default versions for the feature layer. Generate guid for the session.&lt;/P&gt;&lt;P&gt;Then all requests are done through a direct fetch against REST API:&lt;/P&gt;&lt;P&gt;StartReading, StartEditing, ApplyEdits&lt;BR /&gt;ApplyEdits will return an editMoment&lt;BR /&gt;This editMoment is applied to FeatureLayer.historicMoment property to update the display.&lt;/P&gt;&lt;P&gt;At 4.19, you can create a point, you'll see it. The second point, you will not see it:&amp;nbsp; historicMoment is not accounted for by the feature layer.&lt;BR /&gt;At 4.16, the sample works as expected.&lt;/P&gt;&lt;P&gt;It looks like at FeatureLayer.historicMoment does not allow a second mutation of historicMoment property.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 11:48:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1051672#M72752</guid>
      <dc:creator>Frédéric_ALBERT</dc:creator>
      <dc:date>2021-04-27T11:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.historicMoment is ignored when applied several times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1052036#M72772</link>
      <description>&lt;P&gt;Thank you so much for the reproducible case. It was really easy to set it up with our test service. So I was able to reproduce the problem you described. As you have described, api queries are not honoring the FeatureLayer.historicMoment after its initial settings. Subsequent queries are being made with the initial historic moment. I have created an issue for this and do not have a workaround for this. I will be sure to update you once we fix the issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for bringing this issue to our attention.&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 23:47:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1052036#M72772</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-04-27T23:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.historicMoment is ignored when applied several times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1052312#M72785</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756"&gt;@UndralBatsukh&lt;/a&gt;: not sure, but would a requestInterceptor help for this use-case where we inject the historicMoment parameter if it's missing?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 15:19:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1052312#M72785</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-04-28T15:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.historicMoment is ignored when applied several times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1052480#M72796</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/11373"&gt;@JohnGrayson&lt;/a&gt;&amp;nbsp;you are absolutely right! It did not cross my mind. &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/207194"&gt;@Frédéric_ALBERT&lt;/a&gt;&amp;nbsp;if you migrate to 4.19 then you use &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#request" target="_self"&gt;interceptor&lt;/A&gt;&amp;nbsp;in your application.&amp;nbsp;You could do the following and I verified that it is working for me:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const interceptor = {
  urls: [
    "yourServiceURL",
  ],
  before({ url, requestOptions }) {
    requestOptions.query.token = token;
    if (editMoment){
      // where editMoment is updated after applyEdits operation
      requestOptions.query.historicMoment = editMoment.getTime();
    }
  }
};
esriConfig.request.interceptors.push(interceptor);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;-Undral&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 20:47:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1052480#M72796</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-04-28T20:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.historicMoment is ignored when applied several times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1052614#M72803</link>
      <description>&lt;P data-unlink="true"&gt;Using the interceptor as suggested works like a charm.&lt;BR /&gt;I updated the &lt;A href="https://codepen.io/fredalbert/details/NWrBYXM" target="_self"&gt;pen&lt;/A&gt; to implement the workaround and upgraded to 4.19 ESM.&lt;BR /&gt;I hope this will get fixed soon.&lt;BR /&gt;Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 07:36:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1052614#M72803</guid>
      <dc:creator>Frédéric_ALBERT</dc:creator>
      <dc:date>2021-04-29T07:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.historicMoment is ignored when applied several times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1068674#M73507</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want to let you know that we fixed this issue at the JS API version 4.20. The version 4.20 will be released at the end of June (2021).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 22:36:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1068674#M73507</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-06-15T22:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.historicMoment is ignored when applied several times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1120367#M75404</link>
      <description>&lt;P&gt;Does the &lt;STRONG&gt;historicMoment&lt;/STRONG&gt; work to undo/redo in a child branch or only when editing the default branch?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 23:22:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1120367#M75404</guid>
      <dc:creator>HéctorMeléndez</dc:creator>
      <dc:date>2021-11-25T23:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer.historicMoment is ignored when applied several times</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1120395#M75408</link>
      <description>&lt;P&gt;I guess it can be used in many ways, but in my case I used it to provide an undo/redo stack experience while editing utility networks in child branch. Additionnaly child branches also provide different edit sessions at the same time, short or long.&lt;BR /&gt;In the end it is very versatile and poweful and implementation can be as complex as required by your user stories.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Nov 2021 08:33:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-historicmoment-is-ignored-when/m-p/1120395#M75408</guid>
      <dc:creator>Frédéric_ALBERT</dc:creator>
      <dc:date>2021-11-26T08:33:37Z</dc:date>
    </item>
  </channel>
</rss>

