Silent param not working for Update item field values - podio

I'm using version 0.7.9 of the java client library for the Podio API. When sending a value of the true for the silent param, the item update is still displayed in the item's activity stream.
updateItemValues(item.getId(), valuesUpdates, bSilent, bHook)
According to the API documentation that should not be the case.
If set to true, the object will not be bumped up in the stream
and notifications will not be generated.
Default value: false
Question: Is there a way to update an item via the Podio API so that the change is not displayed in the item's activity stream?

Item's activity stream is the only place where all item's changes are shown and only place where you can see who changed what and when and revert those changes. So, no, there is no way to hide this.
Silent parameter works well. There are number of other places where item's changes are shown: notifications, workspace activity stream, home activity stream. And silent parameter is silencing those changes as designed.

Related

Slack API: how to get state of all input/action elements at once upon submit

I'm trying to build rich, interactive Slack messages. Example: message with date picker, set of checkboxes and a long text. Upon submit (if modal) or push of an action button, I'd like to receive the current state of all interactive components.
I have tried regular messages with both input and action blocks...also tried modals. I get a message from Slack for every individual change to an interactive object, but not the state of all objects at once. Since the receiver of the interaction payload is stateless, this makes it impossible for me to properly react to the message.
Am I missing something? Appreciate every bit of advice.
OK, error seems to be on my side. I was just looking at the action payload preview in the Slack Block Kit Builder. When actually posting a message I see the state of all elements in the response.

react-admin edit wait for response

I'm using react-admin to update DB via internal API (not directly from the server react-admin is talking to).
The API call can fail due to various reasons.
Therefore, I want to hold the edit page until it gets the response from the server which is waiting for the response from the internal API.
Is there a way to do this?
You can set its mutationMode to pessimistic.
Extract from the documentation:
The <Edit> view exposes two buttons, Save and Delete, which perform “mutations” (i.e. they alter the data). React-admin offers three modes for mutations. The mode determines when the side effects (redirection, notifications, etc.) are executed:
-pessimistic: The mutation is passed to the dataProvider first. When the dataProvider returns successfully, the mutation is applied locally, and the side effects are executed.
-optimistic: The mutation is applied locally and the side effects are executed immediately. Then the mutation is passed to the dataProvider. If the dataProvider returns successfully, nothing happens (as the mutation was already applied locally). If the dataProvider returns in error, the page is refreshed and an error notification is shown.
-undoable (default): The mutation is applied locally and the side effects are executed immediately. Then a notification is shown with an undo button. If the user clicks on undo, the mutation is never sent to the dataProvider, and the page is refreshed. Otherwise, after a 5 seconds delay, the mutation is passed to the dataProvider. If the dataProvider returns successfully, nothing happens (as the mutation was already applied locally). If the dataProvider returns in error, the page is refreshed and an error notification is shown.

Force GET_ONE request when navigating to Show page

As I believe is common in many APIs, ours returns a subset of fields for a record when it is part of a List request, and more details when it is a single-record request to its Show endpoint.
It seems that react-admin attempts to avoid doing a second request when loading a Show page (possibly re-using the record data from List?), which results in missing data. Refreshing the page fixes this, but I'm wondering if there is a setting that will force a GET_ONE request on every Show page load.
There are no setting for that. However, this should be achievable with a custom saga which would listen to LOCATION_CHANGE action (from react-redux-router) and dispatch a refreshView action (from react-admin) when the new location pathname ends with /show.
Edit: however this is very strange. We only use the data we already got from the list for optimistic display but we still request with a GET_ONE when navigating to a show page from the list. Do you have a codesandbox showing your issue?

cache issue on shopify app

We are developing an app which will display a button on product details page to perform some actions. We are using product.metaifields for displaying the same based on a condition. So basically the button display toggles depending upon the metafield value.
The issue we are facing is, activate the feature from admin section and then the button will not show up on the user side unless we do a hard refresh on the browser. What happens here is Shopify caches the metafield value so the condition checking will not work.
Is there any way to remove the page caching while we perform some action on the app?
When you render a page in Shopify, it renders everything including the metafield resource values you may access while rendering. There is no special caching of a metafield value. If you render a metafield "AAA" on a client-facing page, change the metafield using an App or the Admin to be "BBB" there is no signal to the already rendered page to redraw anything.
If you want dynamic behaviour, like rendering a button with a value based on a metafield resource, you will have to either do a callback to an App, get the new contents, and update the DOM, or use a push strategy like WSS:// to keep a channel open to a backend that monitors these things.
So to sum up, your problem is not one of cached data, but instead the fact that you're rendering a non-dynamic value, and expecting your UX to be dynamic.

GTM dataLayer.push() not working

I am tracking PDF download using custom metric. I have written following code
<script>
dataLayer.push({'DLPdfdownload': 1});
</script>
DLPdfdownload is datalayer variable name that I have created in GTM V2.
Script is executing but the problem is that value for PDF download doesn't increment even if I download particular PDF many time. Value in the custom metric remains 1 only it doesn't increment with the download.
What changes do i need to make in script so that value get increment every time I download a PDF
Your question is somewhat incomplete. I'm going to assume from context that you are using Google Analytics with GTM and that you have already created a custom metric in your property settings.
The custom metric will only be incremented if you send it along with a Google Analytics hit. So you need to look up the numeric index for your metric in the property settings. Then you need to set up an Analytics tag that is triggeres when the pdf is downloaded, e.g. by a link click trigger. In that tag you expand the "custom metrics" section, enter the numeric index of your dimension in the index field and your dataLayer variable in the value field.
If that is what you are already doing, or if I have misunderstood your problem, you need to amend your question with more information.
Try to push some 'event' key's value in dataLayer with custom metric data and use custom event with this value as a trigger. Might be that you send data to GA before your custom metric value is pushed to dataLayer.