I'm trying to ask the main application to find some kind of device, I have been trying to do it with ipc but couldn't make it work either with asynchronous send and sync send. I suspect that the main is trying to reply the promise.
Renderer:
const recognizedDevices = ipcRenderer.sendSync('findDevice');
console.log(recognizedDevices);
Main:
ipcMain.on('findDevice', (event) => findDevice(event));
const findDevice = async (event) => {
let recognizedDevices = await findConnectedDevices();
if(recognizedDevices){
console.log("found");
console.log(recognizedDevices);
return event.returnValue = recognizedDevices;
}
//TODO: If no device found
}
Result in main:
found
[
HID {
_events: [Object: null prototype] { newListener: [Function (anonymous)] },
_eventsCount: 1,
_maxListeners: undefined,
_raw: HID {},
write: [Function: bound write],
getFeatureReport: [Function: bound getFeatureReport],
sendFeatureReport: [Function: bound sendFeatureReport],
setNonBlocking: [Function: bound setNonBlocking],
readSync: [Function: bound readSync],
readTimeout: [Function: bound readTimeout],
getDeviceInfo: [Function: bound getDeviceInfo],
_paused: true,
[Symbol(kCapture)]: false
}
]
I was hoping to receive the same log result in the renderer, but unfortunately I am getting back Error: An object could not be cloned.
If I try to reply back with recognizedDevice.length I will indeed receieve "1" in the front end, so it seem like the communication between them is good. Seems like the problem is with sending the object.
Data exchanged between the main process and the renderer process via IPC channels are serialized via the Structured Clone Algorithm. Functions and symbols are not serialisable yet you're trying to ship them over:
[
HID {
˟ _events: [Object: null prototype] { newListener: [Function (anonymous)] },
_eventsCount: 1,
_maxListeners: undefined,
_raw: HID {},
˟ write: [Function: bound write],
˟ getFeatureReport: [Function: bound getFeatureReport],
˟ sendFeatureReport: [Function: bound sendFeatureReport],
˟ setNonBlocking: [Function: bound setNonBlocking],
˟ readSync: [Function: bound readSync],
˟ readTimeout: [Function: bound readTimeout],
˟ getDeviceInfo: [Function: bound getDeviceInfo],
_paused: true,
˟ [Symbol(kCapture)]: false
}
]
Related
Busy writing some implementation on the beta branch of MS Graph API.
Using GetActivitiesByInterval, it brings back the activity stats (how many activities / how many actors) but no activity sets (itemActivitySet)
{
"StartDateTime": "2023-01-12T00:00:00+00:00",
"EndDateTime": "2023-01-12T23:59:59+00:00",
"Access": {
"ActionCount": 4,
"ActorCount": 1,
"AdditionalData": {
"timeSpentInSeconds": 0
},
"ODataType": "microsoft.graph.itemActionStat"
},
"Create": null,
"Delete": null,
"Edit": null,
"Move": null,
"IsTrending": null,
"IncompleteData": {
"MissingDataBeforeDateTime": null,
"WasThrottled": false,
"AdditionalData": {
"resultsPending": false,
"notSupported": false
},
"ODataType": "microsoft.graph.incompleteData"
},
"Activities": null,
"Id": null,
"ODataType": "#microsoft.graph.itemActivityStat",
"AdditionalData": {
"aggregationInterval": "None"
}
}
There were definitely activities on those, a comment, a rename and a move. I can check those activities are on SharePoint.
I've also tried adding query option expand=activities on returning the drive item but that gives back an empty set (not null, just no data filled with "[],")
There also doesn't seem to be a hidden list called "userActivityFeedHiddenList" in SharePoint that I could use to reference activities for a particular file.
I've googled quite a bit to try and get as much information and went through quite a number of SO posts (hence all the things I tried) but none has worked.
Any suggestions?
I'm facing an issue that i couldn't find a solution for it.
We have updated the version of the cypress from 9.7.0 to 10.2.0 recently, and we used to set the value of testFiles for Docker image using export CYPRESS_TEST_FILES="some files or paths"
Now the testFiles changed to specPattern, and when we use the same method, a new parameter is added to env{} object, and the existing one outside env{} object is still the same.
Now we need a way to change the value of specPattern by exporting the value (we need to change it only in some cases, and not through cypress.config.ts)
cypress.config.ts content:
import { defineConfig } from 'cypress' export default defineConfig({ env: { webBaseUrl: 'http://localhost:4200', highlightColor: '#9ef11a', download_dir: '/cypress/downloads/', }, viewportWidth: 1680, viewportHeight: 1050, defaultCommandTimeout: 15000, reporter: 'mochawesome', video: false, retries: { runMode: 1, openMode: 1, }, reporterOptions: { reportDir: 'cypress/results', overwrite: false, html: false, json: true, }, e2e: { setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, baseUrl: 'https://localhost', specPattern: 'cypress/e2e/**/*.cy.ts', }, })
i tired:
export CYPRESS_specPattern="cypress/e2e/**/*.spec.ts"
then run cypress:
in the settings are i got the following:
and this is the other specPattern value
and it's clear that it's taking the second one into consideration
any suggestions?
I have where on iOS I am creating a WebRTC application that works fine in every other browser and setting except iOS Safari on the iPAd. I've pinpointed the problem to the volume being set to 0.05243a and sometimes to -1. Here is my audio object printed out:
_containerHandlers: {abort: function, canplaythrough: function, ended: function, error: function}
_events: {track.trackMuteChanged: function, track.audioLevelsChanged: function}
_eventsCount: 2
_maxListeners: undefined
_sourceName: undefined
_streamInactiveHandler: function()
addEventListener: function(e,t)
audioLevel: -1
conference: jc {connection: $c, xmpp: Ur, eventEmitter: r, options: Object, eventManager: Qn, …}
containers: [<audio id="ecf6be16audio2">] (1)
disposed: false
handlers: Map {} (0)
hasBeenMuted: false
isP2P: false
muted: false
off: function(e,t)
ownerEndpointId: "ecf6be16"
removeEventListener: function(e,t)
rtc: va {eventEmitter: r, on: function, addEventListener: function, off: function, removeEventListener: function, …}
ssrc: 79236293
stream: MediaStream {listeners: Object, oninactive: function, id: "ecf6be16-audio-1", active: false, onaddtrack: null, …}
track: MediaStreamTrack {listeners: Object, kind: "audio", id: "1260ece4-f00d-4c98-98c3-f5137affeb3a-1", label: "remote audio", enabled: true, …}
type: "audio"
videoType: undefined
volume: 1
Notice while the volume says 1, the audioLevel is -1. And here is several examples of trying to change the volume the volume, the ID his the referencing the audio html element, and the (#${id})[0] is the HTMLMediaElement.
if(track && track.type == 'audio'){
$(`#${id}`)[0].volume = 1;
track.volume=1;
$(`#${id}`)[0].play();
let AudioContext = window.AudioContext || window.webkitAudioContext;
if(AudioContext){
console.log("Audio Context Exist");
let elSound = $(`#${id}`)[0];
let audioContext = new AudioContext()
let gainNode = audioContext.createGain()
gainNode.gain.value = 1
audioContext.createMediaElementSource(elSound).connect(gainNode).connect(audioContext.destination)
elSound.play()
} else {
console.log("Audio Context Not Exist");
}
}
Only the audio fails, video works fine. And this only fails in iOS Safari iPad, works fine everywhere else. Any clues what I might be doing wrong?
I am using googleads API to perform the following operations:
- (1) upload new conversions
- (2) adjust uploaded conversions
The first operation could be done successfuly.
However the second opeartion which is the adjustment of the uploaded conversion is giving the error "INVALID_CONVERSION_TYPE".
According to the documentation in https://developers.google.com/adwords/api/docs/reference/v201809/OfflineConversionFeedService.OfflineConversionError#reason.
The reason for this error is that the conversion name does not match any uploaded conversion for the same customer,
although i have uploaded the conversion with the same conversion name for the same customer.
I am posting my request and the response i am receiving:
request=[{
'operator': 'ADD',
'operand':
{
'adjustmentTime': '20190802 235959 Etc/GMT',
'googleClickId': 'gcliID',
'adjustedValueCurrencyCode': 'EUR',
'conversionName': 'YY',
'adjustedValue': xx,
'xsi_type': 'GclidOfflineConversionAdjustmentFeed',
'conversionTime': '20190731 235959 Etc/GMT',
'adjustmentType': 'RESTATE'
}
}
]
response = {
'ListReturnValue.Type': 'OfflineConversionAdjustmentFeedReturnValue',
'value': [
{
'conversionName': None,
'adjustmentTime': None,
'adjustmentType': None,
'adjustedValue': None,
'adjustedValueCurrencyCode': None,
'OfflineConversionAdjustmentFeed.Type': 'GclidOfflineConversionAdjustmentFeed',
'googleClickId': None,
'conversionTime': None
}
],
'partialFailureErrors': [
{
'fieldPath': 'operations[0].operand.conversionName',
'fieldPathElements': [
{
'field': 'operations',
'index': 0L
},
{
'field': 'operand',
'index': None
},
{
'field': 'conversionName',
'index': None
}
],
'trigger': None,
'errorString': 'OfflineConversionAdjustmentError.INVALID_CONVERSION_TYPE',
'ApiError.Type': 'OfflineConversionAdjustmentError',
'reason': 'INVALID_CONVERSION_TYPE'
}
]
}
Have you ever solved this issue? I'm having the very same one. The only solution I could find is not to use gclid, but switched to orderId - now adjustment works for me.
I am following the instructions at: and am getting the error: http://apiaxle.com/docs/try-it-now/
{"meta":{"version":1,"status_code":504},
"results":{"error":{"type":"EndpointTimeoutError",
"message":"API endpoint timed out."}}}
I'm searching on google but have not yet found how to set a larger timeout.
Looking at the documentation at http://apiaxle.com/api.html, I took a shot and came up with the following:
axle> api "apiname" create endPoint="server.org:port" endPointTimeout=30
Response was:
{ protocol: 'http',
tokenSkewProtectionCount: 3,
apiFormat: 'json',
endPointTimeout: 30,
disabled: false,
strictSSL: true,
sendThroughApiKey: false,
sendThroughApiSig: false,
hasCapturePaths: false,
allowKeylessUse: false,
keylessQps: 2,
keylessQpd: 172800,
endPoint: 'server.org:port',
createdAt: 1400333254388 }
axle> api apiname linkkey "1234"
Response was:
{ qpd: 172800, qps: 2, disabled: false, createdAt: 1400331617778 }
To modify an existing api :
api "apiname" update endPointTimeout=10