Missing registration for cache with ID: 'braintreePreferences' - salesforce

[Wrapped java.lang.IllegalArgumentException: Missing registration for cache with ID: 'braintreePreferences'. (int_braintree/cartridge/config/braintreePreferences.js#4)
in controller Product]
enter image description here

Related

Can I identify if the a traffic is coming from facebook or somewhere else to log AddToCart Event Or Purshes Event on Facebook Pixels

To describe more the issue, I have a business manager account on Facebook and I have implemented everything as it should using React, my problem is when the event AddToCart is firing the count increases on Facebook analytics for AddToCart; event tho the user is coming lets from google or any other social media.
Is it applicable to only limited the events to be firing only if traffic comes from Facebook?
Root.tsx
ReactPixel.init('PIXEL ID', null, {
autoConfig: true,
debug: true,
})
ReactPixel.pageView()
on add to cart button a fire this action
ReactPixel.fbq('track', 'AddToCart', {
contents: [{ id: action.payload.sku, quantity: 1 }],
content_type: 'product',
value: action.payload.price,
currency: 'USD',
})
any advice would be helpful!

The property 'attendees' does not exist on type 'Microsoft.OutlookServices.Event' when trying to update event with Graph API

I'm using Graph API to update calendar events. I've encountered following error on attempt to update calendar event with specific ID: "The property 'attendees' does not exist on type 'Microsoft.OutlookServices.Event"
I'm doing PATCH request using following address:
https://graph.microsoft.com/v1.0//me/events/${id}
with this payload in JSON :
{
attendees: [{emailAddress: {address: "test#test.com", name: "Jan Kowalski"}, type: "required"}]
body: {content: ""}
end: {dateTime: "2022-11-20T21:13:51", timeZone: "Europe/Warsaw"}
location: {displayName: "Dom"}
start: {dateTime: "2022-11-13T21:13:51", timeZone: "Europe/Warsaw"}
subject: "My event"
}
According to the documentation such properties exist.
Get event and deleting event work.
What more when I am trying to do the same update query with the token copied from the Graph Explorer, updating works fine. I am using MSAL2 auth provider for authentication
The question is - am I doing something wrong? May it be something with permissions?

Cannot delete data from datastore in aws-amplify

I am working with AWS amplify for the first time by following the docs. Everything is working except deletion of the data. Whenever I try to delete data from any of my table it gives the error
DOMException: Failed to execute 'index' on 'IDBObjectStore': The specified index was not found.
at Proxy. (http://localhost:3000/static/js/bundle.js:34280:22)
at IndexedDBAdapter. (http://localhost:3000/static/js/bundle.js:25458:82)
at step (http://localhost:3000/static/js/bundle.js:23678:17)
at Object.next (http://localhost:3000/static/js/bundle.js:23609:14)
at fulfilled (http://localhost:3000/static/js/bundle.js:23563:24)
I have tried using all the ways mentioned in the amplify datastore docs, but I always get this error. Following is my graphql schema
type Profile #model #auth(rules: [{allow: groups, groups: ["SME"], operations: [read]}, {allow: owner}]) {
email: String!
name: String
birthDate: String
photo: String
answers: [Answer!] #hasMany
}
type Questionnaire #model #auth(rules: [{allow: private, operations: [read]}, {allow: groups, groups: ["SME"], operations: [create, read, update, delete]}]) {
detail: String!
fields: [Field!] #hasMany
next: Questionnaire #hasOne
previous: Questionnaire #hasOne
}
type Field #model #auth(rules: [{allow: private, operations: [read]}, {allow: groups, groups: ["SME"], operations: [create, read, update]}]) {
question: Questionnaire! #belongsTo
label: String!
options: [String!]!
units: [Units]
answers: [Answer!] #hasMany
}
type Answer #model #auth(rules: [{allow: groups, groups: ["SME"], operations: [read]}, {allow: owner, operations: [create, read, update]}]) {
field: Field! #belongsTo
answers: [String!]!
unit: Units
}
enum Units {
cm
in
ft
kg
lb
sec
min
hrs
days
weeks
months
}
I have set cognito userpool as default authorization type and conflict resolution to "merge".

"No current user" when making unauth Appsync API call for public DB tables

There really isn't enough documentation on this either in the AWS docs or in the Github, so hopefully someone here has tackled a similar issue.
I have a react app with backend api hosted on AWS, using appsync, dynamoDB, and cognito-user-pools. My IAM policies are set up to allow unauth users read-only permission to some public tables. I tried the public api key but that didn't do anything. I'm trying to get the IAM unauth role permissions set up but even when I experimentally added literally every service and every action to the unauth role, I still get "no current user" when attempting to make the API call without logging in.
Use case is for public author pages, where information about an author along with their currently available books is listed. Users should not have to sign in to see this page, an author should be able to drop a link to the page to anyone, whether they have a login for the app or not.
This is my graphql schema for the relevant types, it gets no errors:
type PublicBook #model #auth(rules: [{ allow: owner, operations: [create, update, delete], provider: userPools },
{allow: public, operations: [read], provider: iam}])
#key(name:"byPublicWorld", fields: ["publicWorldId", "indexOrder"])
#key(name:"byPublicSeries", fields: ["publicSeriesId", "indexOrder"]){
id: ID!
publicWorldId: ID
publicSeriesId: ID
indexOrder: Int!
cover: FileObject #connection
description: String
amazon: String
ibooks: String
smashwords: String
kobo: String
goodreads: String
audible: String
barnesnoble: String
sample: String
}
type PublicSeries #model #auth(rules: [{ allow: owner, operations: [create, update, delete], provider: userPools },
{allow: public, operations: [read], provider: iam}])
#key(name:"byPublicWorld", fields: ["publicWorldId", "indexOrder"]){
id: ID!
publicWorldId: ID!
indexOrder: Int!
logo: FileObject #connection
description: String
genre: String
books: [PublicBook]#connection(keyName:"byPublicSeries", fields: ["id"])
}
type PublicWorld #model #auth(rules: [{ allow: owner, operations: [create, update, delete], provider: userPools },
{allow: public, operations: [read], provider: iam}])
#key(name:"byAuthorPage", fields: ["authorPageId", "indexOrder"]){
id: ID!
authorPageId: ID!
logo: FileObject #connection
description: String
genre: String
indexOrder: Int!
series: [PublicSeries]#connection(keyName:"byPublicWorld", fields: ["id"])
books: [PublicBook]#connection(keyName:"byPublicWorld", fields: ["id"])
}
type AuthorPage #model #auth(rules: [{ allow: owner, operations: [create, update, delete], provider: userPools },
{allow: public, operations: [read], provider: iam}])
#key(name:"byPenName", fields: ["penId"])
#key(name:"byPenDisplayName", fields: ["penDisplayName"], queryField: "authorPageByPen"){
id: ID!
authorName: String
penDisplayName: String
penId: ID!
bio: String
photo: FileObject #connection
logo: FileObject #connection
penFBProfile: String
penFBGroup: String
penFBPage: String
penTwitter: String
penInstagram: String
penAmazon: String
penWebsite: String
penNewsletter: String
penGoodreads: String
penPatreon: String
posts: [AuthorPost]#connection(keyName:"byAuthorPage", fields: ["id"])
worlds: [PublicWorld]#connection(keyName:"byAuthorPage", fields: ["id"])
}
type AuthorPost #model #auth(rules: [{ allow: owner, operations: [create, update, delete], provider: userPools },
{allow: public, operations: [read], provider: iam}])
#key(name:"byAuthorPage", fields: ["authorPageId", "timeCreated"]){
id: ID!
authorPageId: ID!
timeCreated: AWSTimestamp!
content: String!
title: String!
subtitle: String
type: PostType!
}
Each of these types is set to owner/cognito permissions for creating, updating, and deleting, and then there is a public auth using iam to read. Seems straight forward enough.
The main type here is Author page, and I have the query set up to pull all the connected relevant cascading information. When logged in, this works fine and shows an author page with all the bits and bobs:
export const authorPageByPen = /* GraphQL */ `
query AuthorPageByPen(
$penDisplayName: String
$sortDirection: ModelSortDirection
$filter: ModelAuthorPageFilterInput
$limit: Int
$nextToken: String
) {
authorPageByPen(
penDisplayName: $penDisplayName
sortDirection: $sortDirection
filter: $filter
limit: $limit
nextToken: $nextToken
) {
items {
id
authorName
penDisplayName
penId
bio
photo {
location
}
logo {
location
}
penFBProfile
penFBGroup
penFBPage
penTwitter
penInstagram
penAmazon
penWebsite
penNewsletter
penGoodreads
penPatreon
posts {
nextToken
startedAt
}
worlds {
nextToken
startedAt
}
_version
_deleted
_lastChangedAt
createdAt
updatedAt
owner
}
nextToken
startedAt
}
}
`;
On the page itself (although in production this just happens at app.js and persists throughout the app), I'm pulling current credentials and logging them to make sure that some kind of IAM identity is being created, and it appears to be:
accessKeyId: "BUNCHANUMBERSKEY"
authenticated: false
expiration: Thu Mar 04 2021 13:18:04 GMT-0700 (Mountain Standard Time) {}
identityId: "us-west-2:48cd766c-4854-4cc6-811a-f82127670041"
secretAccessKey: "SecretKeyBunchanumbers"
sessionToken:"xxxxxbunchanumbers"
That identityId on line 4 is present in my identity pool as an unauth identity, so it is getting back to the pool, which seems to be what's supposed to happen.
So, this identity pool has two roles associated with it, which is standard: auth and unauth, and my Unauthenticated Identities Setting has the box for Enable Access to Unauthenticated Identities checked.
In my unauth role, I've got the following as the inline policy json:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"appsync:GraphQL"
],
"Resource": [
"arn:aws:appsync:us-west-2:MyAccountID:apis/MyAppsyncApiId/types/Mutation/fields/authorPageByPen"
]
}
]
}
I wasn't sure if this needed to be mutation, or query, or what, so I've tried them all. I tried them in combination with 'fields' and with 'index', I've tried writing the JSON, and adding the policies from the inline editor, which gives me the following which also does not work:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": "appsync:GraphQL",
"Resource": [
"arn:aws:appsync:us-west-2:MyAccountID:apis/MyAppSyncAPIId/types/AuthorPage/fields/authorPageByPen",
"arn:aws:appsync:us-west-2:MyAccountID:apis/MyAppSyncAPIID"
]
}
]
}
What bit am I missing here? I could understand getting some error about not being allowed to access a resource, but the only error that logs is No Current User, and that happens immediately after the log showing the user.
Update:
Running the query from the Appsync console works fine with IAM and no logged in user. In the page itself, I'm using the following function to call the author page (I'm using routes):
const pullAuthorPage = async () => {
try{
const authorPageData = await API.graphql(graphqlOperation(authorPageByPen, { penDisplayName: props.match.params.id.toLowerCase() }))
console.log(JSON.stringify(authorPageData, null, 2));
setState({...authorPageData.data.authorPageByPen.items[0]})
} catch (error) {
console.log(error);
}
}
What I thought would happen with this is that if there is no authenticated user logged in, this will run using the unauth user credentials. Is that not the case? And if so, how should I change it?

What is the difference between idParam, idProperty and clientIdProperty

I am curios about the implementations of the idProperty one in the model and one in the reader
and then a idParam for the proxy and a clientIdProperty on the model
How do we I use them in a right way?
if you get this as a response from the server:
{data: [{userid: 1234, username: "foo"}, {userid: 1235, username: "bar"}]}
so in your UserModel you will have idProperty: "userid" this will tell ExtJS which field to use for functions like getId(), getById(). You could also define this in the reader to share between some models, but usually you should define the idProperty in the model.
idParam seems very unclear to me, it is used only 2 time in the whole framework. is only used to modify the request id parameter send to the server. I don't think this is a parameter you will ever need to change.
clientIdProperty is needed for create operations if proxy.batchActions == true. For example: model.clientIdProperty = "extid" this will send to the server if we create 2 users:
{data: [
{extid: "ext-user-1", username: "foo"},
{extid: "ext-user-2", username: "bar"}
]}
server response:
{data: [
{extid: "ext-user-1", userid: 1234, username: "foo"},
{extid: "ext-user-2", userid: 1235, username: "bar"}
]}
this will tell ExtJS how to map the server ids to the pre-generated ext ids.
(if clientIdProperty is null, ExtJS assumes the same order of request and response for the mapping)

Resources