Change repo structure

Ticket Number

N/A
Description of change

Move the repo packages into a /packages directory. This makes it more logical from a monorepo point of view and (hopefully) easier to get started with.
Checklist

[ ] Requires infrastructure changes
[ ] If adding or remove environment variables (e.g. in docker-compose.yaml) then I have updated the appropriate Helm chart
[ ] I have updated the documentation accordingly
[ ] My commit history in this PR is linear
[ ] New features have tests
[ ] Breaking change (team conversation required)

Important
Please do not merge from master (please only rebase). This keeps the history linear and easier to debug.

Something is funky here.
I checked out this branch, but see a couple of odd things:
➜  appeal-planning-decision git:(feature/change-repo-structure) ✗ gst
On branch feature/change-repo-structure
Your branch is up to date with 'origin/feature/change-repo-structure'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	appeals-service-api/

nothing added to commit but untracked files present (use "git add" to track)

Not sure why the appeals-service-api/ is immediately untracked?
➜  appeal-planning-decision git:(feature/change-repo-structure) ✗ make serve
docker-compose up
appeal-planning-decision_blob-storage_1 is up-to-date
appeal-planning-decision_mock-os-places_1 is up-to-date
appeal-planning-decision_mock-horizon_1 is up-to-date
appeal-planning-decision_mock-notify_1 is up-to-date
appeal-planning-decision_mongodb_1 is up-to-date
appeal-planning-decision_docs-horizon_1 is up-to-date
Starting appeal-planning-decision_appeals-service-api-data_1 ...
Starting appeal-planning-decision_appeals-service-api-data_1  ... done
Starting appeal-planning-decision_document-service-uploader_1 ... done
Starting appeal-planning-decision_appeals-service-api_1       ... done
Creating appeal-planning-decision_forms-web-app_1             ... error

ERROR: for appeal-planning-decision_forms-web-app_1  Cannot start service forms-web-app: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting "/host_mnt/Users/christophermoss/Development/foundry4/appeal-planning-decision/packages/common" to rootfs at "/opt/app/node_modules/@pins/common" caused: lstat /var/lib/docker/overlay2/6874163dab586a4e87726b8e21ca0c4f0b4376cb8986fb6ade0c716d64068bdb/merged/opt/app/node_modules/@pins/common: input/output error: unknown

ERROR: for forms-web-app  Cannot start service forms-web-app: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting "/host_mnt/Users/christophermoss/Development/foundry4/appeal-planning-decision/packages/common" to rootfs at "/opt/app/node_modules/@pins/common" caused: lstat /var/lib/docker/overlay2/6874163dab586a4e87726b8e21ca0c4f0b4376cb8986fb6ade0c716d64068bdb/merged/opt/app/node_modules/@pins/common: input/output error: unknown
ERROR: Encountered errors while bringing up the project.
make: *** [serve] Error 1

The dir structure still shows common, forms-web-app, appeals-service-api, and documents-service-api in the top level dir, and the new packages dir.
➜  appeal-planning-decision git:(feature/change-repo-structure) ✗ ls -la
total 680
drwxr-xr-x   30 christophermoss  staff     960  6 Jan 11:36 .
drwxr-xr-x   13 christophermoss  staff     416 16 Nov 15:31 ..
-rw-r--r--    1 christophermoss  staff     254 23 Dec 08:57 .editorconfig
drwxr-xr-x   15 christophermoss  staff     480  6 Jan 11:42 .git
drwxr-xr-x    6 christophermoss  staff     192 23 Dec 08:57 .github
-rw-r--r--    1 christophermoss  staff    2939  6 Jan 11:34 .gitignore
drwxr-xr-x    3 christophermoss  staff      96  6 Jan 11:34 .husky
drwxr-xr-x   10 christophermoss  staff     320  6 Jan 11:31 .idea
-rw-r--r--    1 christophermoss  staff      73 23 Dec 08:57 .prettierrc
-rw-r--r--    1 christophermoss  staff     632 23 Dec 08:57 .releaserc
-rw-r--r--    1 christophermoss  staff       0 23 Dec 08:57 CHANGELOG
-rw-r--r--    1 christophermoss  staff     854  6 Jan 11:34 Makefile
-rw-r--r--    1 christophermoss  staff    5734  6 Jan 11:34 README.md
drwxr-xr-x    4 christophermoss  staff     128  6 Jan 11:34 appeals-service-api
drwxr-xr-x    3 christophermoss  staff      96  4 Nov 14:50 charts
-rw-r--r--    1 christophermoss  staff     189 23 Dec 08:57 commitlint.config.js
drwxr-xr-x    3 christophermoss  staff      96  6 Jan 11:34 common
drwxr-xr-x   11 christophermoss  staff     352  6 Jan 11:36 data
-rw-r--r--    1 christophermoss  staff    4790  6 Jan 11:34 docker-compose.yml
drwxr-xr-x    3 christophermoss  staff      96 17 Nov 10:34 docs
drwxr-xr-x    3 christophermoss  staff      96  6 Jan 11:34 document-service-api
drwxr-xr-x   11 christophermoss  staff     352  6 Jan 11:36 e2e-tests
drwxr-xr-x    7 christophermoss  staff     224  6 Jan 11:34 forms-web-app
drwxr-xr-x    9 christophermoss  staff     288 23 Dec 08:57 infrastructure
drwxr-xr-x    7 christophermoss  staff     224 23 Dec 08:57 mocked-services
drwxr-xr-x  390 christophermoss  staff   12480  6 Jan 11:36 node_modules
-rw-r--r--    1 christophermoss  staff  302988 23 Dec 08:57 package-lock.json
-rw-r--r--    1 christophermoss  staff    1702  6 Jan 11:34 package.json
drwxr-xr-x    6 christophermoss  staff     192  6 Jan 11:34 packages
drwxr-xr-x    4 christophermoss  staff     128 14 Dec 15:57 tmp

I'm not entirely sure what the dir colouring means in webstorm, but the one dir that's showing as untracked in git is a different colour to the other three dirs that moved:

Something is funky here.
I checked out this branch, but see a couple of odd things:
➜  appeal-planning-decision git:(feature/change-repo-structure) ✗ gst
On branch feature/change-repo-structure
Your branch is up to date with 'origin/feature/change-repo-structure'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	appeals-service-api/

nothing added to commit but untracked files present (use "git add" to track)

Not sure why the appeals-service-api/ is immediately untracked?
➜  appeal-planning-decision git:(feature/change-repo-structure) ✗ make serve
docker-compose up
appeal-planning-decision_blob-storage_1 is up-to-date
appeal-planning-decision_mock-os-places_1 is up-to-date
appeal-planning-decision_mock-horizon_1 is up-to-date
appeal-planning-decision_mock-notify_1 is up-to-date
appeal-planning-decision_mongodb_1 is up-to-date
appeal-planning-decision_docs-horizon_1 is up-to-date
Starting appeal-planning-decision_appeals-service-api-data_1 ...
Starting appeal-planning-decision_appeals-service-api-data_1  ... done
Starting appeal-planning-decision_document-service-uploader_1 ... done
Starting appeal-planning-decision_appeals-service-api_1       ... done
Creating appeal-planning-decision_forms-web-app_1             ... error

ERROR: for appeal-planning-decision_forms-web-app_1  Cannot start service forms-web-app: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting "/host_mnt/Users/christophermoss/Development/foundry4/appeal-planning-decision/packages/common" to rootfs at "/opt/app/node_modules/@pins/common" caused: lstat /var/lib/docker/overlay2/6874163dab586a4e87726b8e21ca0c4f0b4376cb8986fb6ade0c716d64068bdb/merged/opt/app/node_modules/@pins/common: input/output error: unknown

ERROR: for forms-web-app  Cannot start service forms-web-app: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting "/host_mnt/Users/christophermoss/Development/foundry4/appeal-planning-decision/packages/common" to rootfs at "/opt/app/node_modules/@pins/common" caused: lstat /var/lib/docker/overlay2/6874163dab586a4e87726b8e21ca0c4f0b4376cb8986fb6ade0c716d64068bdb/merged/opt/app/node_modules/@pins/common: input/output error: unknown
ERROR: Encountered errors while bringing up the project.
make: *** [serve] Error 1

The dir structure still shows common, forms-web-app, appeals-service-api, and documents-service-api in the top level dir, and the new packages dir.
➜  appeal-planning-decision git:(feature/change-repo-structure) ✗ ls -la
total 680
drwxr-xr-x   30 christophermoss  staff     960  6 Jan 11:36 .
drwxr-xr-x   13 christophermoss  staff     416 16 Nov 15:31 ..
-rw-r--r--    1 christophermoss  staff     254 23 Dec 08:57 .editorconfig
drwxr-xr-x   15 christophermoss  staff     480  6 Jan 11:42 .git
drwxr-xr-x    6 christophermoss  staff     192 23 Dec 08:57 .github
-rw-r--r--    1 christophermoss  staff    2939  6 Jan 11:34 .gitignore
drwxr-xr-x    3 christophermoss  staff      96  6 Jan 11:34 .husky
drwxr-xr-x   10 christophermoss  staff     320  6 Jan 11:31 .idea
-rw-r--r--    1 christophermoss  staff      73 23 Dec 08:57 .prettierrc
-rw-r--r--    1 christophermoss  staff     632 23 Dec 08:57 .releaserc
-rw-r--r--    1 christophermoss  staff       0 23 Dec 08:57 CHANGELOG
-rw-r--r--    1 christophermoss  staff     854  6 Jan 11:34 Makefile
-rw-r--r--    1 christophermoss  staff    5734  6 Jan 11:34 README.md
drwxr-xr-x    4 christophermoss  staff     128  6 Jan 11:34 appeals-service-api
drwxr-xr-x    3 christophermoss  staff      96  4 Nov 14:50 charts
-rw-r--r--    1 christophermoss  staff     189 23 Dec 08:57 commitlint.config.js
drwxr-xr-x    3 christophermoss  staff      96  6 Jan 11:34 common
drwxr-xr-x   11 christophermoss  staff     352  6 Jan 11:36 data
-rw-r--r--    1 christophermoss  staff    4790  6 Jan 11:34 docker-compose.yml
drwxr-xr-x    3 christophermoss  staff      96 17 Nov 10:34 docs
drwxr-xr-x    3 christophermoss  staff      96  6 Jan 11:34 document-service-api
drwxr-xr-x   11 christophermoss  staff     352  6 Jan 11:36 e2e-tests
drwxr-xr-x    7 christophermoss  staff     224  6 Jan 11:34 forms-web-app
drwxr-xr-x    9 christophermoss  staff     288 23 Dec 08:57 infrastructure
drwxr-xr-x    7 christophermoss  staff     224 23 Dec 08:57 mocked-services
drwxr-xr-x  390 christophermoss  staff   12480  6 Jan 11:36 node_modules
-rw-r--r--    1 christophermoss  staff  302988 23 Dec 08:57 package-lock.json
-rw-r--r--    1 christophermoss  staff    1702  6 Jan 11:34 package.json
drwxr-xr-x    6 christophermoss  staff     192  6 Jan 11:34 packages
drwxr-xr-x    4 christophermoss  staff     128 14 Dec 15:57 tmp

I'm not entirely sure what the dir colouring means in webstorm, but the one dir that's showing as untracked in git is a different colour to the other three dirs that moved:

The reason for this (and I had the same puzzlement) is because appeals-service-api et al have moved from the root to under /packages. The files left behind in the root directories are just the node_modules, which are untracked.
The simplest way of getting rid is:

in feature/change-repo-structure, run make uninstall
checkout develop, run make uninstall
checkout feature/change-repo-structure, run make install

The root directories should now have disappeared

The reason for this (and I had the same puzzlement) is because appeals-service-api et al have moved from the root to under /packages. The files left behind in the root directories are just the node_modules, which are untracked.
The simplest way of getting rid is:

in feature/change-repo-structure, run make uninstall
checkout develop, run make uninstall
checkout feature/change-repo-structure, run make install

The root directories should now have disappeared


Use consistent terminlogy for mandatory/required/non-nullable

These terms are all interchangeable when speaking of fields on models, so we should determine consistent terminology, update the docs everywhere and stick to it.
Required
e.g. here: https://www.prisma.io/docs/concepts/components/prisma-schema/relations/one-to-many-relations#required-and-optional-relation-fields-in-one-to-many-relations

Mandatory
e.g. here: https://www.prisma.io/docs/concepts/components/prisma-schema/data-model#optional-and-mandatory-fields

Non-nullable
e.g. here: https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#finduniqueorthrow

Not planned, we can re-open if this becomes an issue.


gopass edit fails if 'vi' is not 'vim'

https://github.com/gopasspw/gopass/blob/f5067e6d817530b613205d95fce03e9dd6b67812/internal/editor/editor.go#L104-L109
This fails on FreeBSD since FreeBSD's vi is not vim but nvi and lacks the option -i. There are other Linux distros or *BSD's where this is the case.
See also: FreeBSD issue #267689

Yes, this is a problem.
On the one hand we want to provide a secure by default workflow.
But on the other hand we can't know all possible editors.
What's better: Adding the flags only if we know the editor or only dropping it when we know it won't work?

Yes, this is a problem.
On the one hand we want to provide a secure by default workflow.
But on the other hand we can't know all possible editors.
What's better: Adding the flags only if we know the editor or only dropping it when we know it won't work?

I'm all for secure defaults.
How about setting the flags only if EDITOR is set to vim and print out a warning if another editor is used similar to gpg:
gpg: WARNING: unsafe permissions on homedir '/tmp/foo'

FreeBSD defaults EDITOR=vi, so it continue to fail with same error.
Changing EDITOR=nvi fixes the problem but will be needed user intervention to change EDITOR variable.

FreeBSD defaults EDITOR=vi, so it continue to fail with same error.
Changing EDITOR=nvi fixes the problem but will be needed user intervention to change EDITOR variable.

Confirmed.
An easy way to test if 'vi' is actually a 'vim' would be:
vi --version 2>&1 | grep -q "VIM - Vi IMproved" && echo "vi is vim" || echo "vi is no vim"

You could use the exit code to decide whether 'vi' has the desired capabilities:
Return code 1: vi is no vim:
vi --version 2>&1 | grep -q "VIM - Vi IMproved"; echo $?
1

Return code 0: vi is a vim:
vi --version 2>&1 | grep -q "VIM - Vi IMproved"; echo $?
0

@dominikschulz: can you re-open the ticket or should we create a new issue?


Runtime Exception phpDocumentor expected to find autoloader

I followed the manually install routine from your start page on http://www.phpdoc.org/, so I downloaded the tarball, extracted it into my desired folder and tried to run the phpdoc file. But I got the following error:
Fatal error: Uncaught exception 'RuntimeException' with message 'phpDocumentor expected to find
an autoloader at "C:\xampp\htdocs\phpdoc\src\phpDocumentor/../../vendor/autoload.php" but it
was not there. Usually this is because the "composer install" command has not been ran yet. If
this is not the case, please open an issue at http://github.com/phpDocumentor/phpDocumentor2
detailing what installation method you used, which path is mentioned in this error message and
any other relevant information.' in C:\xampp\htdocs\phpdoc\src\phpDocumentor\Bootstrap.php:102
Stack trace:
    #0 C:\xampp\htdocs\phpdoc\src\phpDocumentor\Bootstrap.php(60): phpDocumentor\Bootstrap->createAutoloader(NULL)
    #1 C:\xampp\htdocs\phpdoc\bin\phpdoc(23): phpDocumentor\Bootstrap->initialize()
    #2 {main}
thrown in C:\xampp\htdocs\phpdoc\src\phpDocumentor\Bootstrap.php on line 102

The exception obviously expected the install routine no. 2 ("Using composer") but I didn't. So I suggest that the repository should be modified in a way that manual install is handled properly or to extend the documentation so that not composer aware people can also install phpDocumentor manually.
Or am I completely wrong here? False assumptions?

Uh, so the latest binary tarball is 2.8.1?


Can't open a PDF file saved as a bookmark in edge browser.

Thanks for the reporting! I can confirm that this doesn't work.
Just wonder how much of that is Edge related, as it sometimes tries to download PDFs ans sometimes open them in the browser itself. Need to look into this, whether the extension can do something about this or whether this is something out of its control.

Thanks for the reporting! I can confirm that this doesn't work.
Just wonder how much of that is Edge related, as it sometimes tries to download PDFs ans sometimes open them in the browser itself. Need to look into this, whether the extension can do something about this or whether this is something out of its control.

This is definitely related to Edge, it works perfectly fine in Chrome.


MediaStore to use common downloads directory of android

Hi, thanks for maintaining this project. i have more of a query than a bug to report.
i'm using version 0.13.8 of this library and implementing scope storage related updates in my RN app.
Is there a way to download files directly to common download path for android, currently file download is happening in app specific internal storage, which might not be very intuitive for users in general.
Is there a plan to implement MediaStore API to make use of download path, or is there any other solution to do so?
Any help or suggestion is much appreciated.
Thanks.

Hi @anshul0410,
at the moment there is no possibility.
But I am currently working on integrating it in the lib.  It's the next feature for the lib and it is already in work :)
But I don't know when it will be done yet

Just wanting to give you a short update.
I have the very basics working now (creating and writing data to media files), but there is still a lot of work to do.
Especially to be able to use fileCache and such things.

@RonRadtke Is there any workaround until the solution is fully implemented? An app needs the invoices to be downloaded in a non-app specific folder, like "Downloads" or "Documents" and we are not sure how we can implement this without your upcoming solution. Thanks!

@afilp in general it is working.
The basics are done.  So saving a file to downloads works.
But I had / have plenty of private issues eating up my time the last moths. So I didn't get to do the work on all the nice-to-have and testing like I would want to in order to make a release for it.
What doesn't work yet:

opening the file after saving it
storing the file without using fileCache
all the functionality around storing files like renaming / moving / copy /delete / ....

If you change to the feature/media_collections branch you could save a file by using the following code snippet.
It's just copied from my testing app, so you might have to adjust variable names etc :)
    ReactNativeBlobUtil
            .config({
                fileCache: true
            })
            .fetch('GET', targeturi, {'Accept': 'application/octet-stream'}, JSON.stringify(dat))
            .then(async (res) => {
                let pathnew = await ReactNativeBlobUtil.MediaCollection.createMediafile({name: filename, parentFolder: '', mimeType: get_mimetype_for_file(filename)}, 'Download');
                await ReactNativeBlobUtil.MediaCollection.writeToMediafile(pathnew, res.path());
});

@RonRadtke Well it would be fine for me if you release a version where we can only download files to that dir. :)

@RonRadtke Would you also provide a snippet for iOS? I can't make it work... It gives me success status, but there are no files in the File.app. I need to have it physically on the users phone so he can access it anytime.

@damian-balas iOS does not use the android mediaStore.
For iOS you need
ReactNativeBlobUtil
            .config({
                fileCache: true
            })
            .fetch('GET', targeturi, {'Accept': 'application/octet-stream'}, JSON.stringify(dat))
            .then(async (res) => {
                await ReactNativeBlobUtil.fs.appendFile(destPath, res.path(), 'uri');
})

So for now you will ahve to put in a switch based on  Platform.OS==='android'

@RonRadtke Thanks a lot Ron! For me, just being able to download a PDF to the common Downloads or Documents folder would be sufficient.
Do we need to have conditionals before the call or the following code will work? (for both iOS and Android?)
I used to have this code in the main config, so I thought the iOS would be OK because of the path there:
       appendExt: 'pdf',         fileCache: true,         path: destPath,
  let dirs = ReactNativeBlobUtil.fs.dirs;
  const dirToSave = Platform.OS === 'ios' ? dirs.DocumentDir : dirs.DownloadDir;
  console.log('dirToSave', dirToSave);
  const destPath = dirToSave + '/Invoice_' + paymentId + '.pdf';

  // const date = new Date();
  const { data } = await new Promise((resolve, reject) => {
    try {
      ReactNativeBlobUtil.config({
        appendExt: 'pdf',
        fileCache: true,
        path: destPath,
        addAndroidDownloads: {
          path: destPath,
          /*        destPath:
          dirs.DownloadDir +
          '/Invoice_' +
          Math.floor(date.getTime() + date.getSeconds() / 2),*/
          useDownloadManager: true,
          title: 'Invoice ' + paymentId,
          description: 'Invoice PDF',
          mime: 'application/pdf',
          mediaScannable: true,
          notification: true,
        },
      })
        .fetch('GET', `${window.our.BASE_URL}/payment?paymentId=${paymentId}`, {
          Authorization: `Bearer ${token}`,
          Accept: 'application/pdf',
          'Content-Type': 'application/pdf',
        })
        .progress((received, total) => {
          console.log('progress', received / total);
        })
        .then(async res => {
          console.log('The file saved to ', res.path());
          Alert.alert(t('invoiceDownloaded'));
          if (Platform.OS === 'ios') {
            await ReactNativeBlobUtil.fs.appendFile(
              destPath,
              res.path(),
              'uri',
            );
            ReactNativeBlobUtil.ios.openDocument(res.path());
          } else {
            const android = ReactNativeBlobUtil.android;
            android.actionViewIntent(
              res.path(),
              'application/pdf',
              'Choose app to preview',
            );
          }
          resolve(res);
        })
        // Something went wrong:
        .catch((errorMessage, statusCode) => {
          console.log(errorMessage);
          reject(errorMessage);
        });
    } catch (err) {
      console.log(err);
      reject(err);
    }
  });

@damian-balas iOS does not use the android mediaStore. For iOS you need
let destPath = ReactNativeBlobUtil.fs.dirs.DocumentDir + '/' + filename;
ReactNativeBlobUtil
            .config({
                fileCache: true
            })
            .fetch('GET', targeturi, {'Accept': 'application/octet-stream'}, JSON.stringify(dat))
            .then(async (res) => {
                await ReactNativeBlobUtil.fs.appendFile(destPath, res.path(), 'uri');
})

So for now you will have to put in a switch based on  Platform.OS==='android'. Downloaddir on iOS doesn't work since there is no download folder like on android.

Thanks for your feedback. I'm aware of this, but my issue is that I can't see the downloaded file in the native File app. It's empty.
this is my code:
export const downloadPdf = async ({ url, filename }) => {
  let response;
  const newFilename = `${filename}-${Date.now()}`;
  if (!url || typeof url !== 'string') {
    throw new Error('Link do pliku PDF jest niepoprawny!');
  }

  try {
    if (Platform.OS === 'ios') {
      response = await downloadForIOS({ filename, url });
    } else {
      response = await downloadForAndroid({ filename, url });
    }

    showSuccessToast({
      text: `${newFilename}.pdf został pobrany pomyślnie!`, // TODO: translate this!
    });
  } catch (error) {
    showErrorToast({
      error: {
        message: `Nie udało się pobrać ${newFilename}.pdf. Spróbuj jeszcze raz.`, // TODO: translate this!
      },
    });
    Logger.error(error);
  } finally {
    if (response?.flush) {
      // response.flush();
    }
  }
};

const downloadForAndroid = async ({ filename, url }) => {
  const result = await request(PERMISSIONS.ANDROID.WRITE_EXTERNAL_STORAGE);

  if (result !== RESULTS.GRANTED) {
    throw new Error(result);
  }

  const response = await ReactNativeBlobUtil.config({
    fileCache: true,
  }).fetch('GET', url);

  const newPath =
    await ReactNativeBlobUtil.MediaCollection.createMediafile(
      {
        name: `${filename}.pdf`,
        parentFolder: '',
        mimeType: 'application/pdf',
      },
      'Download',
    );

  await ReactNativeBlobUtil.MediaCollection.writeToMediafile(
    newPath,
    response.path(),
  );

  return response;
};

const downloadForIOS = async ({ filename, url }) => {
  const path = ReactNativeBlobUtil.fs.dirs.DocumentDir + '/' + filename;
  const response = await ReactNativeBlobUtil.config({
    fileCache: true,
  }).fetch('GET', url);

  await ReactNativeBlobUtil.fs.appendFile(path, response.path(), 'uri');
  return response;
};

The lib currently doesn't support the option to save it to files app.
But you can set
UIFileSharingEnabled
and
LSSupportsOpeningDocumentsInPlace
To yes in yours app plist file. (Just take the link below and search for the first entry, there it is explained that itit should work... can't get a working link tonit on the phone sorry,)
Or see https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW37

Thanks!
Made it work with this code:
const downloadForIOS = async ({ filename, url }) => {
  const path =
    ReactNativeBlobUtil.fs.dirs.DocumentDir + '/' + filename + '.pdf';
  const response = await ReactNativeBlobUtil.config({
    fileCache: true,
    appendExt: 'pdf',
    path,
  }).fetch('GET', url, {
    Accept: 'application/pdf',
    'Content-Type': 'application/pdf',
  });

  ReactNativeBlobUtil.ios.previewDocument(path);
  return response;
};

But... the user needs to click: Save to Files button :)

@afilp
Sorry just saw your post now.
In general you should be able to use the config, just that the useDownloadManager might make problems, and the rest of the fields would not be respected by the write method for the mediastore.
And ofc you'll have to exchange the methods for writing the file on android.
So for your else part you need a  await ReactNativeBlobUtil.fs.appendFile(destPath, res.path(), 'uri');. The actionViewIntent does not work yet, as stated, not sure what the problem is.
I will fix it in a way that the config will be used. But currently I won't have the time for that.
@afilp @damian-balas
And as soon as the config works and the opening of the files works I'll make a release for and by that push the version to 0.14.x
If anyone of you has some time to help / test I would be very glad about it

@RonRadtke Thank you for your efforts!
I tried everything and still the file goes to the app's sandboxed storage and not to a common documents folder (note: I am not using your special branch, should I?).
I tried to make it work with your advice to check these 2 properties in plist to true:

But still, res.path() and destpath are exactly the same, the app's one:

I tried all combinations, even having fileCache: false,, still it does not work.
Also, this code only works once per session, it never works again for the next download:
ReactNativeBlobUtil.ios.openDocument(res.path());
Thanks a lot or all your efforts!

That's how storage in iOS works.
Apps can only ever write in the sandbox storage.
The only possibility you have is either saving it to the file app as you pointed out.
The option I pointed out (setting the two flags) will make the files browsable by the files app and thus leads to the files show up in the files app. That's basically the only option you have if you don't want the user to have to save it again.

That's how storage in iOS works. Apps can only ever write in the sandbox storage. The only possibility you have is either saving it to the file app as you pointed out. The option I pointed out (setting the two flags) will make the files browsable by the files app and thus leads to the files show up in the files app. That's basically the only option you have if you don't want the user to have to save it again.

Is is secure to make those files visible?

Is is secure to make those files visible?

In general yes. Of course it is your responsibility to make sure there is no info available the user should not be able to access, like config files. Same it is your responsibility to make sure you don't store any malware etc there. But it is in general fine to use, the official developer docu of apple is describing it explicate so we can use it, it's not a hack or sth like that.

@RonRadtke Sorry if this is irrelevant, i am using react-native-image-picker, how could I create a video file from this uri inside the same folder with the others? With appendFile? Thank you!

where did you get the file from?
It looks like it is a file from mediastore. Currently the library can't do anything with such URIs in means of loading the file to store it somewhere else e.g.

I used react-native-image-picker and I just picked a video file. The type and data are what I get as a response (among other fields such as size, duration, etc. that I do not need to upload in the form.

No currently not.
The content URI is indicating that it is an uri from a content provider. So it's not a path it is a reference to a certain file.
Basically you need to use a contentResolver and get the InputStream from that one, and with that stream you can write the file in the app specific directory. (Some MediaStore magic)
And that is currently not implemented.
I know who to set a method up to do what you need. But I won't have time to do so until maybe Monday.

@RonRadtke Thanks a lot for your feedback.
We have an app in the store and Android (only) users cannot upload the "picked" videos, so if we could have a solution by Monday that would be great indeed!
Please note that I am not particularly interested to "copy" the video file to the "app-specific" folder (this was just a suggestion), I am interested for react-native-blob-util/  to just upload the file no matter where it is located, or whether it is a "content" or a "file" one. Of course, if intermediate custom steps are needed to be programmed by us (for example copying something somewhere), please let us know and we will do!
Thanks a lot!

Well, I can't promise I get it done on Monday. Depends a lot on how much spare time I'll have and how much I have to work / family.
But I'll try.
Of course it would be possible without that intermediate step too. But I would like to have it as a separate module and don't mess the library up too much by having every functionality everywhere.
Besides, on modern phones copying a single file really shouldn't be an issue storage wise.

Yes Ron, I understand.
FYI, I tried to do an fs.copyFile logic and I have reached a wall...
err Error: Permission Denial: reading com.android.providers.media.MediaDocumentsProvider uri content://com.android.providers.media.documents/document/video:45772 from pid=20415, uid=10641 requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs
The code I am using is this:
if (type === 'video' && Platform.OS === 'android') {
      let dirs = ReactNativeBlobUtil.fs.dirs;
      const dirToSave =
        Platform.OS === 'ios' ? dirs.DocumentDir : dirs.DownloadDir;
      try {
        console.log('dirToSave', dirToSave);
        const destPath = dirToSave + '/' + filename + '.' + typeForTheFilename;

        debugger;
        await fs.copyFile(decodeURIComponent(el.uri), destPath);
      } catch (err) {
        console.log('err', err);
      }
      const res = await fs.readDir(dirToSave);
      debugger;
      console.log('res', res);
    }
    ```

I updated the code and I see that I do get true for the READ_EXTERNAL_STORAGE permission, so in theory I do have permission to read the file from there (or not?).

These are the Android permissions, I even added the "MANAGE_DOCUMENTS" to no avail:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />

No you don't. Because the file does not belong to your app.
I would recommend reading a bit about scoped storage.
Basically by default you can only read / write within the scoped storage belonging to your app. And only your app, no other app and neither the user itself, has access to these files.
So if you want access to a file somewhere else (e.g. in the images/videos in the gallery) first of all the user has to select the file actively (you can't just query a random file, except with file manager permissions) , and then you need to use certain functions to be allowed to read these files.
They changed the whole storage system with Android 10, you still have the "old" system in mind.
But that's all the magic happening in java / kotlin you usually don't see when just programming your app in react-native.

Thanks Ron, so the problem with the "content" file will still be there unless you find a way for all of us to be able to get it as an actual file inside the app's scoped storage. I wish react-native-image-picker had an option for us to save the actual file instead of providing a "content" link.
Meanwhile, I managed to write to the common "Downloads" folder using react-native-file-access, which is the opposite direction (I needed this in order to be able to save a downloaded PDF there, using their fetch). I wonder if this could be used somewhere in your library.
Thanks a lot!

@afilp to the downloads folder you can save with my library on the new branch...
So there is no need for the additional library.

No you misunderstood me. They are 2 different problems.
I still have the major problem of "content" video files not being able to be uploaded to our server, because there is no way at the current master branch to get the actual file from a "content" uri.
My initial asking about saving to Downloads also still remains. I only mentioned the other library as I found it just 2 hours ago and gave it a try in case there is something there that my help you with the implementation/testing of your branch.
Thanks a lot..

Okay, thanks. Might help with my problem, that I have to use the cache file, but will see.
I wrote a new function copyToInternal which should do the work and copy the file to the apps internal storage. Just need to specify the contenturi and the targetpath.
But it is untested and I don't have time to test it right now. So feel free to test it  :D Otherwise I might get to it tomorrow or on monday.

Thanks a lot Ron, you are awesome!
The copyToInternal function can be used to also get the video file from the "content" uri in media store (in the format the picker gives) and upload it?
Or this is only for solving the initial problem with the "downloads"?

@afilp
Yes to the first.
This function will copy a file given by content URI (so the video you get from react-native-image-picker) to the apps internal storage.
And after that being done you can use it like every other file in the apps storage (so like the images you get from react-native-image-picker), and thus should be able to upload it.
So:

pick the image
copy it with await ReactNativeBlobUtil.MediaCollection.createMediafile(<contenturi>, <internal targetpath>)
send it to the sever as usual

WIth  being e.g. ReactNativeBlobUtil.fs.dirs.CacheDir
Saving to dowloads works too.
For that you need sth like the following:
    ReactNativeBlobUtil
            .config({
                fileCache: true
            })
            .fetch('GET', targeturi, {'Accept': 'application/octet-stream'}, JSON.stringify(dat))
            .then(async (res) => {
                let pathnew = await ReactNativeBlobUtil.MediaCollection.createMediafile({name: filename, parentFolder: '', mimeType: get_mimetype_for_file(filename)}, 'Download');
                await ReactNativeBlobUtil.MediaCollection.writeToMediafile(pathnew, res.path());
});````

Explanation:
``ReactNativeBlobUtil.MediaCollection.createMediafile(...)`` will create a new MediaStore file with the given name / subfolder / ...
``ReactNativeBlobUtil.MediaCollection.writeToMediafile`` will write the data from the fileCache (so res.path()) into the new media storage file
So with these two function calls after the fetch resolved you're able to write the file to the public downloads folder.

Thanks @RonRadtke
Meanwhile, I read a lot for a possible workaround and found a post that said the he used stat and just took the actual file uri through this. I tried it and it did work (i.e. the actual video did upload):
        const stat = await ReactNativeBlobUtil.fs.stat(el.uri);
        el.uri = stat.path;

Was that just a lucky coincidence? Maybe because it was in Movies?

I wonder if this can be a solution or it will fail in many other cases.
Thanks.

@afilp it works, but it might fail. A URI doesn't necessarily has to be a file or anything you can read or use. So it might work for all your cases since you come over the picker. But in general it is something that will sooner or later break.
An other possibility that would likely would work would be to return a BLOB object containing the data of the file - that would skip the copy part too.
But copying will do the cut for now too.
Regardless getting the BLOB or so would be a nice feature in general.
So if you don't have a problem with, I would say we stick with the copying for now. At least that is the fastest way you will be able to use that functionality, since I don't have that much time currently (exams, work, family, ...)
And I will keep working on the mediastore, add a few more functions and then release it officially. But till then, you can use the branch.

Very interesting discussion. Thanks @RonRadtke for working on this repo. I ended up here as I am also facing the issue of saving files to the shared "Download" folder.
With the old package, I was simply using RNFetchBlob.fs.dirs.DownloadDir (which returned /storage/emulated/0/Download) as the target folder, and then copying (with RNFetchBlob.fs.cp(sourcePath, targetPath)) files from the cache to the target.
In this package, ReactNativeBlobUtil.fs.dirs.DownloadDir returns /storage/emulated/0/Android/data/<myapp>/files/Download. After reading the comments here and in other forums, I was under the impression that this change was motivated by some change in the Android API, which would not allow to save to the shared Download folder anymore.
So I just quickly tested hardcoding the target to /storage/emulated/0/Download and tried copying files from the cache to the target. It worked both on a physical device running Android 9, and on an emulator (Pixel 5) running Android 11.
So I am not quite sure why ReactNativeBlobUtil.fs.dirs.DownloadDir doesn't return /storage/emulated/0/Download as before. Am I misunderstanding something?
Note: I just use the standard permissions READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE in the manifest.

This should not work unless you're using preserveLegacyExternalStorage=true.
It was changed because the way to aquire the paths was changed. The old methods ate flagged deprecated and the new return other values.
It came with one of the PRs I mergred after taking over the lib. But it is in general not possible to write there anymore, especially since the flag mentioned only works on targetapilevel < 30.
But as mentioned in one PR there would be the possibility to add a flag to get the old paths. Even though it won't help anyone targeting Android 11 (api 30), which is mandatory for all updates by now.

Oh you're right, I do have android:requestLegacyExternalStorage="true" in the manifest. So I guess the MediaStore API is the best way to go from now on.

@afilp so copying to the app storage works. So basically all functionality you need is available on the feature branch.
I also managed to fix the issue with opening a file downloaded to the downloads folder, so we're getting closer for a release - at least if we skip the whole part in the config with overwrite / fileCache=false / ....

Excellent! I am looking forward to the release and use it asap!
Also, remember that I tried meanwhile to solve the problem of just copying to a "public" folder with another library?
See here, while it works in Android, I have a problem in iOS, it still tries to write in a "non-public" (app-specific) Downloads folder.
https://github.com/alpha0010/react-native-file-access/issues/41
I am only mentioning it, so that you get inspired of the issue and maybe your branch solves this problem too. Thanks!

@afilp as explained already. It's not possible.
The only option to offer would be an action for the user to save it manually by himself. But there the user probably would also see all other options about sharing the file.

Sorry I have not realized this well, so the only way is to use the Share method of react-native and hope that uses will find the "Save" option.

Yes, at least if you want it saved there and are not fine with it being shared and thus be visible there.
I don't understand why you want to explicitly store it in downloads / documents and not just show it there. The user won't see the difference.

@RonRadtke Maybe I get this wrong, but when react-native-blob-util downloads the PDF then we show an alert that says something like "PDF Downloaded". But then the user has no clue what to do next to get to the actual file. I wonder if there is a way to have a link to that particular folder in the FIles app, so that the Files app opens in that folder for the user to view the file immediately.

@afilp there are basically two options:

Tell the user he will find it in the documents folder (if you have sharing active and save it to the documents folder)
Open the file for the user with  ReactNativeBlobUtil.ios.openDocument(destPath)

I did use both the  previewDocument and the openDocument, like that:
if (Platform.OS === 'ios') {
            ReactNativeBlobUtil.ios.previewDocument(res.path());
          }
          ```

However, it only works the first time during the entire app's session. It does not appear the next times I download a document, the same or others. Is this a bug I assume? Have you noticed this behavior? I do not know why this happens.

Yes that is for sure a bug.
If there is no issue yet, could you please create one for? So we don't have too much of a mess in this one here

Sure, here it is:
https://github.com/RonRadtke/react-native-blob-util/issues/108

For info, I decided to go ahead for now with the cpExternal(soucePath, destPath, dirType) function from https://github.com/alpha0010/react-native-file-access, which uses the MediaStore API. dirType can be 'downloads', 'images', 'audio' or 'video'.
It pretty much fits my app's use case since user files are already downloaded and in the cache, and just need to be copied and made available outside of the app. Would be great if react-native-blob-util eventually had a similar function.

@alariej yep, is planned for this or next week :)

Thanks @RonRadtke
Meanwhile, I was reading a lot about this issue as many other users face it with pickers and found a post that said the he used stat and just took the actual file uri through this. I tried it and it did work (i.e. the actual video did upload):
        const stat = await ReactNativeBlobUtil.fs.stat(el.uri);
        el.uri = stat.path;

Was that just a lucky coincidence? Maybe because it was in Movies?

I wonder if this can be a solution (no need to copy anything) or it will fail in many other cases/devices/Android versions/etc,
Thanks.

@RonRadtke I just tried it in a tablet, picking (with image-picker) an mp4 video from the Downloads folder which I downloaded previously from Google.
I get this error, is there any way to solve this?

The strange thing is that the behavior is different (it works) in my Android phone, while both have Android 11 version.
I assume they have a different way to store the "Downloaded from Google" video file.

@afilp it's released!
The issue with stat is what I described earlier. There is no guarantee for the row actually pointing to a file. And the issue you're seeing here is exactly that. There is no way to solve that except for switching to the newly introduced APIS

I'll reopen the issue again - just in case you have feedback.
If there are any new bugs - please create a new issue though

Thanks Ron!
Maybe you missed to type the row here?

@afilp it's released!
The issue with stat is what I described earlier. There is no guarantee for the row actually pointing to a file. And the issue you're seeing here is exactly that. There is no way to solve that except for switching to the newly introduced APIS

With your new v0.14 we do not need to do anything else other than use it, correct? Not sure what you meant with switching to the newly introduced APIS. This is done on v0.14, correct? Or we have to manually do something more? Thanks!

Also, I tried to update the Wiki but I do not have update permissions:
From:
let destpath = ReactNativeBlobUtil.dirs.CacheDir
To:
let destpath = ReactNativeBlobUtil.fs.dirs.CacheDir
(there is a missing fs there, I believe)
Maybe you would like to change this.

Thanks Ron!
Maybe you missed to type the related code here?

no, that's exactly want I meant to write. You get a database row (or multiple) from a query. But probably it would be better to write cursor instead of row, since we get a cursor not a single row.

@afilp it's released!
The issue with stat is what I described earlier. There is no guarantee for the row actually pointing to a file. And the issue you're seeing here is exactly that. There is no way to solve that except for switching to the newly introduced APIS

With your new v0.14 we do not need to do anything else other than use it, correct? Not sure what you meant with except for switching to the newly introduced APIS. This is done on v0.14, correct? Or we have to manually do something more? Thanks!

You need to use the new functionality. it's not a replacement for the old one, it's an addition. So you will have to call the correct functions as described in the wiki.

Ι tested it in both my Android phone and tablet and worked perfectly!
Thanks a lot!

Hi @RonRadtke, thank you for working so actively on this library. It's been really useful for developers like me who aren't familiar with native Android code. You have no idea how happy I was to see v0.14 released this morning!
On that note, I've been trying to get v0.14 to work on Android 7 but I'm having issues. I'm thinking one of the issues might be in this method from ReactNativeBlobUtilMediaCollection.java (added my questions as comments in the code):
public static Uri createNewMediaFile(FileDescription file, MediaType mt) {
    ...

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
     ...
    } else {
        File directory = Environment.getExternalStoragePublicDirectory(relativePath);
        if (directory.canWrite()) {
            File f = new File(relativePath + '/' + file.getFullPath()); // <-- Instead of relativePath, should it be directory.getPath() instead? Right now this seems to be causing the createNewMediaFile method to return null
            if (!f.exists()) {
                boolean result = f.mkdirs(); // <-- Should this be f.createNewFile() instead? Right now it's creating a folder
                if (result) return Uri.fromFile(f);
            }

        }
    }

    return null;
}

I tried replacing making the following replacements and the file got created successfully in the public downloads folder:

directory.getPath() instead of relativePath
f.createNewFile() instead of f.mkdirs()

However this led to another problem in the writeToMediaFile() method:

Here's a relevant snippet of my React Native code:
  ReactNativeBlobUtil
     .config({
       fileCache: true,
       path: `${Platform.OS === 'ios'
         ? ReactNativeBlobUtil.fs.dirs.DocumentDir
         : ReactNativeBlobUtil.fs.dirs.DownloadDir
       }/${filename}`,
     })
     .fetch('GET', url, {...})
     .then(async (res) => {
       if (Platform.OS === 'ios') {
         ...
       } else {
         const result = await ReactNativeBlobUtil.MediaCollection.copyToMediaStore(
           {
             name: 'TestFile',
             parentFolder: '',
             mimeType: 'application/pdf',
           },
           'Download',
           res.path(),
         );
       }
     });

I'm not sure if this is considered a new bug. If it is, I'll create a new issue as requested.

Hi @jaedontym,
thank you very much for appreciating my work here. It really helps to now people do like and sue my work.
And thanks for the bug report.
You're partly right.
I absolutely forgot to actually create the file. I'm currently only creating the parent directories, but we have to create these too, we can't just only create the file. This will otherwise lead to an error if the parent directory doesn't exist.
I am working on a fix for it, I just want to test it first since I did some more clean up and  adding that the write method works for older APIs too.

@RonRadtke Thank you so much. Can't wait to integrate the updates to get my app working properly with the newer Android versions!
I'll continue reporting relevant bugs here as I find them :)

@RonRadtke Just to make sure, the picker store in the "Cache", right? So this gets bigger and bigger? Or is it automatically cleaned when closing the app, etc.?
I asking in case I have to manually delete the selected images/videos after the user uploads them to the server, using react-native-blob-util.
If yes, I should use this method of yours?  ReactNativeBlobUtil.fs.mv
Thanks!

Yes that will grow. Unlink would be the way to go.

I'm facing problem with copyToMediaStore , I get this error : Failed to get output stream
here is my code
const result =
await ReactNativeBlobUtil.MediaCollection.copyToMediaStore(
{
name: eventTitle,
parentFolder: '',
mimeType: 'application/pdf', // MIME type of the file
},
'Download',
${filePath},
);
and filePath is : /storage/emulated/0/Android/data/com.runofshow/files/Download/Test.pdf

Yes that will grow. Unlink would be the way to go.

I did not see in the docs what type is the response data, is it always a boolean? I am using JSON.parse as I though it can also be an object and I need to return it back to react-query:

So, what should we expect for "data" there? Thanks!  (on uploading success I mean)

What type is the response data, is it always a boolean?
I am using JSON.parse as I though it can also be an object and I need to return it back to react-query:

So, what should we expect for "data" there? Thanks!  (on uploading success I mean)

UPDATE: I do see the photo in the UI, but when trying to re-upload it it shows as missing. So why the UI shows it while it is not there?

Which UI?

So, what should we expect for "data" there? Thanks! (on uploading success I mean)

Whatever your server sends. The data is the raw value your server is sending, or, if your config is specifying to store it in a file, the path.
So depending on what your goal is, it might be better to use the text() or json() since this will resolve a file path and return the data sent by the server.

@RonRadtke Hi Ron! How are the fixes coming along? I hope that no additional complications arose 😰
I went ahead with the app internal storage implementation first but this is affecting the UX of downloading and uploading files quite a bit (most users don't know how to navigate to the directory). Fortunately that's not the app's main feature but I do hope to be able to get this sorted out in time.
As always, really appreciate your work to keep rn-fetch-blob alive and up-to-date even with your busy schedule!

@jaedontym sorry I had 2 exams and some private issues so I got kinda delayed.
But I think I got it fixed, I will run some more tests tomorrow and if these are fine I'll craft a new release.

@RonRadtke I hope your exams went smoothly and your private issues get resolved. Take care, Ron 🙏

@jaedontym Update is released

@HagarAyad the update I released yesterday might fix your problem too. I found a way to reproduce it and fixed it - but I of course can't promise there isn't anything else wrong (e.g. another app modifying the file or so)
@jaedontym thanks! The function should now work as expected and also work on android < 10. With the next update I plan to bring back the old environment paths that should enable being able to write to the public download folder on old devices agian.
@afilp how's it going? everything working well with that part of the lib?

@RonRadtke Yes, I did not even need that fix, most likely because our users have recent Android versions, but of course it is nice to have this too!
My other (unrelated) problem is when users pick in iOS many heavy images through the picker (8MB each for example) and I show them in a Flatlist. When there are 15+ of them, I have reports that the app is crashing when scrolling to the end of the list.
If you happen to know how to cope with this issue I will greatly appreciate this! I am thinking of using react-native-resizer, create duplicate smaller images as thumbnails, to show these in Flatlist, while using  react-native-blob-util to upload the original large images one-by-one.


Added the graph teams channel set command resolving #816

Updates properties of a specified channel in a Microsoft Teams team

Coverage remained the same at 100.0% when pulling 5539b7630e46800e64475eeb75bad585df2a9d9e on rabwill:issue-816 into 555bce61b81450d3615bb2f9cf4e4a7121ee47f2 on pnp:dev.

Hi @waldekmastykarz this is ready for review. Thank you.

Perfect! Thank you @rabwill! I'll review it shortly

Thanks @waldekmastykarz I will get onto them this evening.

Hey @waldekmastykarz so I have gone in a refactored a bit of code , and all yours :)

Awesome! Thank you for a quick turnaround 👏

Thank you for the changes @rabwill. We're almost there, just need one more change.

Hey @waldekmastykarz , I think 3 is the charm for this one. Appreciate your patience :) cheers!

Excellent! Thank you for the quick turnaround! 👏

Merged manually. Thank you! 👏

Thanks you! 👏🏻


wrong currency

new Intl.NumberFormat('en-US', {
    style: 'currency',
    currency: 'EUR'
}).format(1);

returns: $ 1.00 it seems that the currency option gets ignored... it takes always the currency from the locale's location

I second that. I have the same issue. The weird thing is that for some reason the locale affects the currency (which isn't supposed to be like that). My example:
Intl.NumberFormat('bg-BG', { style: 'currency', currency: 'BGN' }).format(1)
// returns 1.00 лв. which is correct
Intl.NumberFormat('en-US', { style: 'currency', currency: 'BGN' }).format(1)
// returns $1.00 which is incorrect - it should return BGN 1.00

In both cases the currency is the same (BGN) but the printed currency symbol is different.

UPDATE: I tested this on iOS and it seems to work correctly which means that the issue is probably specific to Android.

This pull request seems to fix the issue for me

more than 6 months are passed and no one was able to merge this awesome bug fixing PR :see_no_evil:

more than 6 months are passed and no one was able to merge this awesome bug fixing PR 🙈

I still use a local version with that fix because of that


Added new resources about Kubernetes

Hey, @trimstray can you take a look?

Hey, @trimstray can you take a look?

Both are commercial blogs that are over that line of actively selling
"Cheat sheet" is just a blog, basically web formatted kubectl help output
Neither adds anything to the resources already in the book
👎


fix 305 by using a scalar uint as param for zero param functions

Which issue does this PR close?
fix 305 by using a null array as param for zero param functions
Closes #305.
Rationale for this change
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
What changes are included in this PR?
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
Are there any user-facing changes?
If there are user-facing changes then we may require documentation to be updated before approving the PR.
If there are any breaking changes to public APIs, please add the breaking change label.

if https://github.com/apache/arrow-datafusion/pull/328 can be merged then this can be closed

closing this as we are aligned on using NullArray.


AICOO - A Decentralized AI co-create Platfrom

Title of your project
AICOO
Short (1-2 sentence) description of your project
AICOO is a decentralized AI co-create platfrom. Anyone can initial a new collection and set conditions for who can paticipate. All participants co-created used AI tool and share the royalty of the collection.
Link to your project
https://www.aicoo.xyz/
Live on Testnet
No
If your project is live on one of Taiko's testnets, please provide evidence of that here (eg. links, screenshots). If your project is NOT live, please provide your plan for integration here.
We have not connected to Taiko yet, we participated in lens devgrant and got the reward.  Now we plan to run our application on an Ethereum layer 2 network, Taiko is an important choice for us, and we also hope to get support.
Upload a quality logo to your project

Hi @mydoto, what are the integration plans for Taiko? e.g. the integration timeline and how it will be integrated.

@2manslkh We will complete the operation of existing functions on Taiko network in 2 weeks.

@mydoto any updates?

@2manslkh Yes, AICOO has been updated and now supports Taiko on the Jolnir testnet.  You can have a try. For stable access, we deployed the graph of Taiko ourselves.
And, Please add our project on the Ecosystem page.


added touch events

I added touchstart, touchend, and touchmove events to the list. Passes all the unit tests and my tests on an iPad.
Created a touchstart example also, but couldn't use your vodoo code for it.

Fixed my issue. Just what I needed.

Happy Birthday to my first open source PR 🍰
On the 10th anniversary of this PR, I've decided it is time to close it.
Rest easy little PR, your time is done.


x/sys/unix: fchmodat under linux silently fails when passing flags

Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go1.8.1
What operating system and processor architecture are you using (go env)?
linux amd64
What did you do?
Using syscall.Fchmodat and setting the AT_SYMLINK_NOFOLLOW flag, e.g.
import (
	"syscall"
	"golang.org/x/sys/unix"
)

func main() {
	syscall.Fchmodat(unix.AT_FDCWD, "/tmp/file", 0755, unix.AT_SYMLINK_NOFOLLOW)
}

What did you expect to see?
Expected to see an error, as according to the kernel source the syscall doesn't accept the flags parameter and the glibc source returns an ENOTSUP.
What did you see instead?
Instead, the call silently drops the flags parameter and follows the symlink, applying the fchmodat to the destination (or failing if the destination file can not be altered).

The cause of this the prototype for the syscall generator is wrong as while the libc version supports flags the syscall version doesn't:
http://lxr.free-electrons.com/source/include/linux/syscalls.h#L776

FYI, there is a patch for adding a fchmodat2() syscall to the Linux kernel which will support a flags parameter with AT_SYMLINK_NOFOLLOW set (currently still under discussion): https://patchwork.kernel.org/patch/9596301/


Build Issue with Samples

MacOS
After updating VS, XCode, downloading and installing all the packages from this list (https://github.com/dotnet/net6-mobile-samples), and rebooting, I get the following error following the readme instructions:
dotnet build HelloMaui -t:Run -f net6.0-maccatalyst
Microsoft (R) Build Engine version 16.10.0-preview-21126-01+6819f7ab0 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
/Users/Projects/Microsoft/net6-mobile-samples/HelloMaui/HelloMaui.csproj : error MSB4057: The target "Run" does not exist in the project.

You need --no-restore as described here:
https://github.com/dotnet/net6-mobile-samples#net-maui
This should be fixed in the next preview: https://github.com/dotnet/sdk/issues/15485


Unhelpful error messages when a condition fails

When there are multiple conditions in a specification (in my experience, 3 or more), the error messages provided to the user are often obscure.
Example
With files
(*example.mli*)
type 'a t

val silly_create : int -> 'a t
(*@ t = silly_create c
requires c >= 5
requires c < 10
requires c = 0
*)

(*myexe.ml*)
let _ = Example_ortaced.silly_create 0

running
~/issue ᐅ ortac example.mli > example_ortaced.ml
~/issue ᐅ dune build
~/issue ᐅ dune exec ./myexe.exe

produces
File "example.mli", line 3, characters 0-153:
Runtime error in function `silly_create'
  - the invariant
      `s c = '
    was violated in the pre-state.
Fatal error: exception Ortac_runtime.Error(_)

Of course, it is the "requires c >= 5" condition that is violated, but the message 's c =' does not reveal this.  Full example is included below in a zip file.
Cause
The culprit is the function term_printer on line 10 of ortac/src/core/translate.ml. The argument string text is the full text of the specification. In the example, this is
 t = silly_create c
requires c >= 5
requires c < 10
requires c = 0

I think the intent of the code is for global_loc.loc_start.pos_cnum and t.t_loc.loc_start.pos_cnum to be indices into the original file as written by the user, making t.t_loc.loc_start.pos_cnum - global_loc.loc_start.pos_cnumthe start of the violated condition c >= 5 in text. However, global_loc.loc_start.pos_cnum and t.t_loc.loc_start.pos_cnum are instead indices into preprocessed code (given by Pps.run on line 37 of parse_ocaml_lb in gospel/src/parser_frontend.ml). Printing the string output by Pps.run reveals that some characters are inserted between the start of the specification comment and the start of c >= 5 during preprocessing. The index t.t_loc.loc_start.pos_cnum - global_loc.loc_start.pos_cnum does indicate the start of c >= 5 in the preprocessed spec.
Solution
I tried to locally create a fix where the string stored in the sp_text field of the specification representation (type val_spec  in gospel/src/tast.ml) is the preprocessed spec, rather than the spec written by the user. In the example, this would mean that the argument text to term_printer would be
[@@gospel
# 4 "example.mli"
 {| t = silly_create c
requires c >= 5
requires c < 10
requires c = 0
|}
# 8 "example.mli"
 ]

I think this would work, but I couldn't figure out a simple means of achieving it without modifying a lot of code.
Alternatively, the body of term_printer could be replaced by Fmt.str "%a" Tterm_printer.print_term t. In the example, this would produce an error message of
File "example.mli", line 3, characters 0-153:
Runtime error in function `silly_create'
  - the invariant
      `((integer_of_int
c:int):integer >= 5:integer):prop'
    was violated in the pre-state.
Fatal error: exception Ortac_runtime.Error(_)

issue.zip

Thanks for reporting this, the locations were fixed in https://github.com/ocaml-gospel/gospel/pull/214, so the printing will be fixed too when I upgrade ortac to the latest Gospel (which should happen soon-ish) :)

Apparently there is still an issue with some locations provided by Gospel, moving this issue there.


[Winds of Magic] Suffuse with  — Incorrent effects

Suffuse with <wind> effects incorrectly add +1 SL Bonus to Channelling Tests, while they should add +1 Success SL to Casting Tests.
From: forienfoundry: 11.315wfrp4e: 7.0.3wfrp4e-altdorf: 4.0.1wfrp4e-archives1: 4.0.2wfrp4e-archives2: 4.0.2wfrp4e-core: 4.0.2wfrp4e-dotr: 4.0.2wfrp4e-eis: 4.0.1wfrp4e-middenheim: 4.0.2wfrp4e-pbtt: 4.0.2wfrp4e-rnhd: 4.0.1wfrp4e-salzenmund: 4.0.1wfrp4e-starter-set: 4.0.0wfrp4e-up-in-arms: 4.0.1wfrp4e-wom: 4.0.1wfrp4e-zoo: 4.0.1Active Modules: ATL, JB2A_DnD5e, _CodeMirror, _chatcommands, arms-reach, autoanimations, chat-commander-wfrp4e, colorsettings, custom-css, darkraven-games-soundscapes-free, dfreds-chat-pins, dfreds-effects-panel, dice-so-nice, entice-with-dice-so-nice, forien-actors-summary, forien-ammo-swapper, forien-armoury, forien-copy-environment, forien-custom-utility, forien-easy-polls, forien-quest-log, forien-unidentified-items, foundryvtt-simple-calendar, image-hover, item-piles, ivan-duch-music-packs, levels, lib-wrapper, light-switch, local-shared-compendiums, michaelghelfi, monks-hotbar-expansion, moulinette-core, moulinette-imagesearch, moulinette-scenes, moulinette-tiles, multi-token-edit, permission_viewer, polyglot, popout, quick-insert, remote-highlight-ui, sequencer, socketlib, soundfxlibrary, stairways, sweetnothings, tabletop-rpg-music, times-up, token-action-hud-core, token-action-hud-wfrp4e, token-ease, token-variants, trs-foundryvtt-dice-set, trs-metal-rainbow, update-your-password, wall-height, wfrp4e-dotr-maps, wfrp4e-gm-toolkit, wfrp4e-random-treasure, wfrp4e-unofficial-grimoire

This is incorrect:

Should add here instead:


Feature request: Preserve hierarchy in todo lists

A request for an enhancement.

I have todo lists items scattered everywhere, as do many others.
However, mine are often hierarchalized by context. For example:

[ ] A category

[ ] An item in this category
[ ] Another item in this category

When I check off all items in the category, I check the category as well. That's how I keep mental track of what would otherwise be hundreds of single items.
Could Checklist preserve these hierarchies in its display. It would quadruple its usefulness for users like me.
Thanks,
Thomas

Is this related to #127?

Actually it's not. Without a picture of what #127 is asking for, it's hard to judge.
But this requests is to preserve indents, which represent hierarchy at the source.
Thanks for looking at this.
Thomas

I second this. Without nesting this plugin is kinda useless.


The execution time cost of authenticate_gss_client_step varies in a big range like 0~10 seconds？

In most time, it costs only milliseconds for authenticate_gss_client_init to return.Sometimes, less than 1 percentage, it takes 5 seconds to 10 seconds.
In authenticate_gss_client_init, gss_init_sec_context costs most time.
Why?

Is there any pattern here, such as the amount of time between the longer-duration calls? Also what platform are you using? Anything special about your Kerberos configuration?

I tested the calls one by one,and sometimes it took long time.
The platform is ubuntu 12.04.Nothing is special of config, I think,
kdc_timeout = 2500
clockskew = 300
use_dns_lookup = 0
udp_preference_limit = 1465
max_retries = 3
dns_lookup_kdc = false
dns_lookup_realm = false
renewable = false
forwardable = false
renew_lifetime = 0m
max_renewable_life = 30m
What could affect the time cost?

by adding log print I found gssint_import_internal_name,

by adding log print I found the function gssint_import_internal_name,

By adding log print I found the statement in the function gssint_import_internal_name cost long:
status = mech->gss_import_name(minor_status, union_name->external_name,
union_name->name_type, internal_name);

@apli That sounds kind of like it might be stalling in DNS lookups (unrelated to dns_lookup_kdc or dns_lookup_realm).
When you're doing the testing, are you using the same inputs every time? If you are seeing wide variance with the same inputs, I would be looking towards things like DNS record TTLs or maybe kerberos ticket lifetime. One thing you could do is watch for DNS requests (using tcpdump or whatever) to see if there are external DNS queries that align with the slow calls. An occasionally slow external resolver (or congested network along the path to it) could result in this sort of behavior. Also I'm reading some stuff about gss_import_name that suggests that if the form of the input is such that a hostname is expected, and is absent, the local host is used. Sometimes machines have multiple DNS entries (perhaps via /etc/hosts) for 'localhost'. Maybe one of them resolves to an IPv6 address, but some portion of your stack is not v6 capable.
By the same token (heyo, kerberos puns), an external KDC may be occasionally slow in granting a TGT, or any other network interaction for that matter - but if so I wouldn't expect that slowness to show up under gss_import_name.

@dreness Thanks a lot.
You're right.It's related to the DNS lookups .I think it's the response cost of the DNS server that causes the problem. I  repeated the test  after commentting the DNS server in DNS config, and the long-time calls never showed up.
In fact ,I don't need  a DNS  server to do the DNS  lookup for the kdc address is configured in /etc/hosts and not registered in the DNS server.Seems it still use DNS server first.When the DNS server response slowly the long-time call shows up.
Is there any way to use /etc/hosts first?
The order in /etc/nsswitch.conf of my machine is hosts: files dns.

@dreness
Problem solved. After your advice , I used tcpdump to watch DNS requests，I found the DNS request for the host of the principle which is not in /etc/hosts.
Thanks again!

 Glad you fixed it.


toString does not get called automatically (in chrome) when passing messages to/from webworkers

Hi, in my version of Chrome 16.0.899.0 dev the javascript engine does not appear to call 'toString' on the json object being posted to a webworker...
Would stringifying the object manually like this work ok for you?
PS Didn't include minified source, not sure which app you prefer to use for minification.

I intentionally don't call toString. It's there for browsers that don't support the structured clone algorithm. Chrome 16 supports the structured clone algorithm, so the full object is sent. Outdated browsers are limited to JSON-only (e.g. no ImageData, etc.)

Thanks, I thought that's probably the reason - never-the-less chrome doesn't call "toString" at all and fails with
'Uncaught Error: DATA_CLONE_ERR: DOM Exception 25'...

Wait, sorry - misread your comment slightly. My version of Chrome 16.0.899.0 dev, at least, fails with the exception. Not sure what's wrong there

Tell me if you still get that error if you remove the toString entirely. Chrome 16 may have a stricter implementation of the SCA that throws of encountering functions.

Yes, that's quite strange in the sandbox-worker.js it only works with stringify:
postMessage(jsonStringify(response));

but in sandbox.js, stringify isn't needed:
this[$worker].postMessage({
    id       : id,
    method   : method,
    data     : data,
    input    : input
});

which is pretty strange (maybe a browser bug?)
However, adding toString : jsonStringifyThis to either results in DATA_CLONE_ERR.
I was looking at https://developer.mozilla.org/en/DOM/The_structured_clone_algorithm previously which says "Error and Function objects cannot be duplicated by the structured clone algorithm; attempting to do so will throw a DATA_CLONE_ERR exception." Don't know if that helps...?

It's a bit of a pain. I think you need to somehow detect whether the browser supports structured clone, but I don't know how you'd go about that. Only option I see is:
try {
    postMessage(...);
} catch() {
    postMessage(jsonStringify(...));
}

Which doesn't seem ideal.

The only way to test it without actually sending a message would probably be to throw an exception immediately after toString is called. I haven't tested this code, but it might work.
var sca_supported = true;
try {
    postMessage({toString:function(){
        sca_supported = false;
        throw ""; // stopping postMessage call
    }});
} catch(ex) {}


MissionRaw stopped working from v1.2.0 to v1.3.0

In my android app after uploading from io.mavsdk:mavsdk-server:1.2.1 to io.mavsdk:mavsdk-server:1.3.1 I noticed that I could not upload the mission. After downgrading to 1.2.1 the functionality was the same as before.
I could upload with
implementation 'io.mavsdk:mavsdk:1.2.0'
implementation 'io.mavsdk:mavsdk-server:1.2.1'
and could not upload with
implementation 'io.mavsdk:mavsdk:1.3.0'
implementation 'io.mavsdk:mavsdk-server:1.3.1'
In the log I am receiving a warning "W  Invalid sequence for ArduPilot items"  and in Wireshark I can not see any mavlink messages sent. The MISSION_COUNT message is not sent.

Are you using Ardupilot?

I am using Ardupilot.
I have found that in C++. I downloaded and found that piece of code. The part that I cannot understand is that with the method of implementation of mission with MAVSDK, it makes no sense for that piece of code to make any trouble since no one has to add the mission_count message in mavlink. It is added automatically automatically by mavsdk.
I will past the mission plan with all elements I am using.
`
private val MAV_FRAME_MISSION = 2
private val MAV_FRAME_GLOBAL_RELATIVE_ALT = 3
private val MAV_FRAME_GLOBAL_TERRAIN_ALT = 10
private val MAV_CMD_NAV_WAYPOINT = 16
private val MAV_CMD_NAV_RTL = 20
private val MAV_CMD_NAV_TAKEOFF = 22
private val MAV_CMD_CONDITION_YAW = 115
private val MAV_CMD_DO_CHANGE_SPEED = 178
private val MAV_CMD_DO_SPRAYER = 216
private val MAV_CMD_DO_SET_SERVO = 183
val missionItems : ArrayList<MissionRaw.MissionItem> = ArrayList()
var seq = 0
missionItems.add(
MissionRaw.MissionItem(seq++,
MAV_FRAME_GLOBAL_RELATIVE_ALT, MAV_CMD_NAV_TAKEOFF,
1, 1,
0.0F, 0.0F, 0.0F, Float.NaN,
0, 0, alt,
0)
)
missionItems.add(
MissionRaw.MissionItem(seq++,
MAV_FRAME_GLOBAL_RELATIVE_ALT, MAV_CMD_NAV_TAKEOFF,
0, 1,
0.0F, 0.0F, 0.0F, Float.NaN,
(currentPos.latitude * 10.0F.pow(7)).toInt(), (currentPos.longitude * 10.0F.pow(7)).toInt(), alt,
0)
)
for( i in waypoints.indices)
{
//Set Steady Heading for each mission waypoint
missionItems.add(
MissionRaw.MissionItem(seq++,
MAV_FRAME_GLOBAL_TERRAIN_ALT, MAV_CMD_CONDITION_YAW,
0, 1,
90.0F - activityViewModel.angleProgress.value!!.toFloat(), 0.0F, 0.0F, 0.0F,
0, 0, 0.0F,
0)
)
// Add Relative Waypoint to Mission
missionItems.add(
    MissionRaw.MissionItem(seq++,
        MAV_FRAME_GLOBAL_TERRAIN_ALT, MAV_CMD_NAV_WAYPOINT,
        0, 1,
        0.0F, 0.0F, 0.0F, Float.NaN,
        (waypoints[i].latitude * 10.0F.pow(7)).toInt(), (waypoints[i].longitude * 10.0F.pow(7)).toInt(), alt,
        0)
)

// After First Mission waypoint added
if(i == 0)
{
    // Set Sprayer Enable ON
    missionItems.add(
        MissionRaw.MissionItem(seq++,
            MAV_FRAME_GLOBAL_TERRAIN_ALT, MAV_CMD_DO_SPRAYER,
            0, 1,
            1.0F, 0.0F, 0.0F, 0.0F,
            0, 0, 0.0F,
            0)
    )

    // Set Servo ON
    missionItems.add(
        MissionRaw.MissionItem(seq++,
            MAV_FRAME_GLOBAL_TERRAIN_ALT, MAV_CMD_DO_SET_SERVO,
            0, 1,
            5.0F, sprayerIntensityPWM, 0.0F, 0.0F,
            0, 0, 0.0F,
            0)
    )

    // Set user preferable speed in m/s
    missionItems.add(
        MissionRaw.MissionItem(seq++,
            MAV_FRAME_GLOBAL_TERRAIN_ALT, MAV_CMD_DO_CHANGE_SPEED,
            0, 1,
            1.0F, activityViewModel.flightSpeed.value!!.toFloat(), 0.0F, 0.0F,
            0, 0, 0.0F,
            0
        )
    )
}

}
// Set Sprayer Enable OFF
missionItems.add(
MissionRaw.MissionItem(seq++,
MAV_FRAME_GLOBAL_TERRAIN_ALT, MAV_CMD_DO_SPRAYER,
0, 1,
0.0F, 0.0F, 0.0F, 0.0F,
0, 0, 0.0F,
0)
)
// Set Servo OFF
missionItems.add(
MissionRaw.MissionItem(seq++,
MAV_FRAME_GLOBAL_TERRAIN_ALT, MAV_CMD_DO_SET_SERVO,
0, 1,
5.0F, 1000.0F, 0.0F, 0.0F,
0, 0, 0.0F,
0)
)
// RTL - Return To Land
missionItems.add(
MissionRaw.MissionItem(seq,
MAV_FRAME_MISSION, MAV_CMD_NAV_RTL,
0, 1,
0.0F, 0.0F, 0.0F, 0.0F,
0, 0, 0.0F,
0)
)
`

We need to make a docs entry of how the sequence need to be for ArduPilot (and PX4).
The 0th item is home (or empty). The 1st item is the "first" waypoint and has sequence 0. Can you try that?

The above implementation is the one that I have found out that it works with a lot of trial and error.
If I understand correctly what you are saying is to replace the first element on my list
(this one)
missionItems.add(
MissionRaw.MissionItem(seq++,
MAV_FRAME_GLOBAL_RELATIVE_ALT, MAV_CMD_NAV_TAKEOFF,
1, 1,
0.0F, 0.0F, 0.0F, Float.NaN,
0, 0, alt,
0)
)
with this?
missionItems.add(
MissionRaw.MissionItem(seq++,
MAV_FRAME_GLOBAL_RELATIVE_ALT, MAV_CMD_NAV_WAYPOINT,
1, 1,
0.0F, 0.0F, 0.0F, Float.NaN,
curPos.latitude, curPos.longitude, alt,
0)
)
and after that the rest of the elements should be the same? So after the 0th element which will be MAV_CMD_NAV_WAYPOINT there should be a MAV_CMD_NAV_TAKEOFF as 1st element? This should function on both 1.2.0 and 1.3.0?

I have changed the first element to the following
        missionItems.add(             MissionRaw.MissionItem(seq++,                 MAV_FRAME_GLOBAL_RELATIVE_ALT, MAV_CMD_NAV_WAYPOINT,                 1, 1,                 0.0F, 0.0F, 0.0F, Float.NaN,                 (currentPos.latitude * 10.0F.pow(7)).toInt(), (currentPos.longitude * 10.0F.pow(7)).toInt(), alt,                 0)         )
In v1.2.0 it still works and I can upload the mission but in v1.3.0 it fails to upload still with " W  Invalid sequence for ArduPilot items"

with this for 0th element?
missionItems.add( MissionRaw.MissionItem(seq++, MAV_FRAME_GLOBAL_RELATIVE_ALT, MAV_CMD_NAV_WAYPOINT, 1, 1, 0.0F, 0.0F, 0.0F, Float.NaN, curPos.latitude, curPos.longitude, alt, 0) )

I think you don't want seq++ here. The sequence should be: 0, 0, 1, 2, 3, ... Can you make sure that's what you're sending?

I might be wrong on this and I should make a simple Python example to show it. It's clearly a bit of challenge.

ok. I found the issue. My code was working on version 1.2.0 but stopped working on v1.3.0. After @julianoes last comment I started digging into Python examples and found the mission_import.py example. I added a loop to print out the elements of the example-mission.plan and noticed the correct sequence. My problem was that even when I tried with the correct sequence(0, 0, 1, 2, 3 ...) I was not using the correct sequence with current and autocontinue as shown below in example-mission.plan. The current needs to be 0 in the first mission_item(Waypoint:16) and then 1 in the second waypoint(Takeoff:22)
MissionItem: [seq: 0, frame: 5, command: 16, current: 0, autocontinue: 1, param1: 0.0, param2: 0.0, param3: 0.0, param4: 0.0, x: 473977420, y: 85455939, z:<PHONE_NUMBER>277344, mission_type: 0]
MissionItem: [seq: 0, frame: 3, command: 22, current: 1, autocontinue: 1, param1: 0.0, param2: 0.0, param3: 0.0, param4: nan, x: 473977420, y: 85455939, z: 50.0, mission_type: 0]
MissionItem: [seq: 1, frame: 3, command: 16, current: 0, autocontinue: 1, param1: 0.0, param2: 0.0, param3: 0.0, param4: nan, x: 473982266, y: 85455604, z: 50.0, mission_type: 0]
MissionItem: [seq: 2, frame: 3, command: 16, current: 0, autocontinue: 1, param1: 0.0, param2: 0.0, param3: 0.0, param4: nan, x: 473982493, y: 85449242, z: 50.0, mission_type: 0]
MissionItem: [seq: 3, frame: 3, command: 16, current: 0, autocontinue: 1, param1: 0.0, param2: 0.0, param3: 0.0, param4: nan, x: 473977416, y: 85449242, z: 50.0, mission_type: 0]
MissionItem: [seq: 4, frame: 2, command: 20, current: 0, autocontinue: 1, param1: 0.0, param2: 0.0, param3: 0.0, param4: 0.0, x: 0, y: 0, z: 0.0, mission_type: 0]
When I applied the same paradigm on my code it works on both v1.2.0 and v1.3.0.

Thank you for your support. I was wrong, it was not an issue after all.

Hi @prokas-nikos,
The current sequence for mission sequence is 0,1,2,3, etc. We had incorrectly implemented ardupilot mission validation which has been now corrected and pushed to the main branch. I am not sure about the status in v1.3.0, but i believe that release was from much before the addition of ardupilot mission validation check.
If you are using ArduPilot, I would suggest to use the main branch instead of specific tagged versions since many ardupilot related changes are in the main branch. After the release of v2.0 these should be available also in the release.
More information on how to setup and work with ArduPilot and MAVSDK are in this repository https://github.com/ykhedar/ardupilot-mavsdk which I specifically created to help devs like you get started with this combination. Give it a try and let me know if you face any problem.

I am not sure about the status in v1.3.0, but i believe that release was from much before the addition of ardupilot mission validation check.

I backported it: https://github.com/mavlink/MAVSDK/pull/2065
It's part of v1.4.15
I need to update the Python wrappers to be based on top of it.

@JonasVautherin can you update the Java wrappers as well? Thanks.

Hi @ykhedar,
thanks for the info. I will check out for sure. The reason I moved to previous versions was to locate where the issue came. I am using MAVSDK one year now, and when I tried to make some changes to my app and upgrade to the latest version of MAVSDK the problem appeared.

This has been fixed in MAVSDK v1.4.15, MAVSDK-Python v1.4.7, and MAVSDK-Java 1.3.2.
Thanks @ykhedar and @JonasVautherin.


Config file being over written every restart

Problem/Motivation
The config file is being overwritten, includiung edits everytime the hass.io addon is restarted
Expected behavior
I am happy for new speakers to be added to the config file but existing edits should be persistant
Actual behavior
Edits to existing speakers names and active status and settings like changing the codec from pcm back to flc (default) I didnt expect
Proposed changes
is there a setting I need to change so the config file is not created entirely each restart?

ok, might have been my config naming causing the issue
e.g. I had Kid's Room and should have had Kid's Room


Renamed navmesh_create to navmesh_add since no navmesh is created.

While documenting Navigation I noticed there's navmesh_create, but then there's navmesh_remove. Looking closer at the code, navmesh_create requires an already created navmesh but instead simply adds it to a Map, therefore navmesh_add is an accurate name and navmesh_create is not. It also is more consistent with navmesh_remove.. IE. 'add' and 'remove'.

Technically there is a NavMesh struct that gets created internally, but the end user will never see it, so when they see navmesh_add/create they will associate that with the NavigationMesh resource that gets passed into the method (which is linked in the struct), not with an internal NavMesh struct itself.

Needs to include an updated doc/classes/Navigation.xml in the same commit.

@menip Thanks, I had it renamed in my other PR documenting Navigation, but it's a much better idea to rename it in this one :)

I am fine with this, but needs to be done on Navigation2D too

@reduz Thanks Juan, both Navigation and Navigation2D are changed... and docs updated with the changed property name :)


Add other elevation options

Do you have any desire to see other elevation options? I have a tool that queries usgs for USA and another international source and could be added to this library as an option to rgb tiles. Let me know and I'll take a stab at adding this option.

@reyemtm sounds nice idea. Feel free to fork the repo and make a PR for your implementation! Thanks!


Jira 5476 add headers

We're trying to reduce the amount of information on the README.

I don't like this at all. Please change everything.


Unable to use preLaunchTask with two configurations

VSCode Version: 1.11.1
OS Version: ubuntu

Steps to Reproduce:

Create two watching task using typescript compiler named srv and web in tasks.json.
In launch.json create three configurations:

srv for node with preLaunchTask=srv
web from chrome with preLaunchTask=web
compound launch named both, which starts both launch configurations: srv and web

If I start srv debugging all works ok. But if I then start web debugging I get "There is a task srv running. Can not run pre launch task web." Same happens if I start compound task named both.
But I'm able to run both tasks srv and web at the same time if I start them with Run task command. Of course, I must remove preLaunchTask, if I want to start debugging, otherwise I get same error.
br

This is the problem of the task framework only supporting to run one task at a time.
Assigning to @dbaeumer as he might have better recomendations on how to setup your environment

@isidorn not sure, because I use tasks version 2.0.0. and I'm able to run both watch task at the same time without problems. But if two watch task are running I'm unable to start debugging if preLaunchTask is also set.

@edvinv this issue is probably that the preLaunchTask uses tasks 1.0.0 underneath

@isidorn  actually the new runner support starting more than one tasks but the debugger needs to adopt this. Since the new terminal is not the default yet I recommend that we wait with the adoption. What is clear is that I need to let the debugger now whether the task framework supports multiple parallel tasks or not since users could still configure the old runner. Opened https://github.com/Microsoft/vscode/issues/24670 to track this.
Assigning back to you.

Assigning to Mai since this is dependent on #24670

@dbaeumer let me know if you are not planning to tackl #24670 in May so I also postpone this

@isidorn sorry for this. Lets move to June. It is a little late for feature although this is not too complicated.

@isidorn @dbaeumer was this corrected in last release 1.18? Because now I'm able to have compound launch configuration, containing two launch configurations,  each having different preLaunchTask task and Start debugging (F5) correctly starts both prelaunch  tasks.
The problem is then is that debugger doesn't wait for both tasks to end before attaching debug session.
If I start  single webpack prelaunch tasks I also get error "The preLaunchTask 'web' cannot be tracked."

This got addressed with the new task 2.0.0 support which allows to run multiple launch configs. The canot be tracked issues is discussed here: #37997


all lists should allow subgroupings

Some list elements (<biblList>, <eventList>) allow subgroupings while others don't, i.e. MEI allows something like
<biblList>
  <biblList/>
  <biblList/>
  <biblList>
    <biblList/>
  </biblList>
</biblList>

but disallows the same with workList or expressionList.

Ok lists should definitely behave in a common way to some degree. But I think to some degree biblList originates from a earlier stage of modelling MEI than the rather recent workList and expressionList. The latter two now are to be seen in the FRBR-context which brings up the modelling of relations and thus relationList. The question consequently is: what does a nested list actually mean?

is it just a means of grouping?
does it bring hierarchical implications?
does it imply inclusion?
…

In this context, I'm not really sure about the meaning of:

<biblList>
  <biblList/>
  <biblList/>
  <biblList>
    <biblList/>
  </biblList>
</biblList>

Maybe we should even discourage / disallow such use?

Nesting  permits the creation of, well, nested lists like –

My favorites

Movies
    …

Books
    …

Not necessarily useful within a simple header, but potentially very useful in explanatory text that might be found in, say, a thematic catalog.
--
p.
From: Benjamin W. Bohl<EMAIL_ADDRESS>Sent: Wednesday, April 8, 2020 3:25 PM
To: music-encoding/music-encoding<EMAIL_ADDRESS>Cc: Subscribed<EMAIL_ADDRESS>Subject: Re: [music-encoding/music-encoding] all lists should allow subgroupings (#636)
Ok lists should definitely behave in a common way to some degree. But I think to some degree biblList originates from a earlier stage of modelling MEI than the rather recent workList and expressionList. The latter two now are to be seen in the FRBR-context which brings up the modelling of relations and thus relationList. The question consequently is: what does a nested list actually mean?

is it just a means of grouping?
does it bring hierarchical implications?
does it imply inclusion?
…

In this context, I'm not really sure about the meaning of:

<biblList/>

Maybe we should even discourage / disallow such use?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/music-encoding/music-encoding/issues/636#issuecomment-611145848, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABLSX3NX677DUH4DAXCB7FDRLTFSLANCNFSM4JQOBRTQ.

 and  intentionally do not allow for hierarchical relationships between their “items”.  Those relationships can be expressed in other ways.

That’s what I was trying to say, too ;-)
Thanks for putting it simple @pe-ro

Oh, I’m definitely good at being simple. 😊
Seriously, it must be remembered that many of the elements used in both the header and in the “text-y bits” serve multiple purposes – their nature is often not just “this or that”, but rather “this and that”.  I’m aware of the inconsistency, but inconsistency and ambiguity are, like the poor, with us always.

If you'd want a hierarchical organised list of works you probably should stick with biblList and make the entries reference the respective work


Question: Adding custom post types to the home page

I'm learning how to use Hugo,  I've created custom types (project and component) and am experiencing the following issues:
I can't add the new post types.  I see the the paginator code in article-list.html {{ $paginator := .Paginate (where .Site.Pages "Type" "post") }} but it only uses the post type and I don't know how do I incorporate types other than posts.
Can a dev comment the code with instructions or document this? The Hugo instructions make no mention of this?
Am I missing something? I'm creating the new post types to differentiate them and use different HTML in each type and, as far as I've been able to tell you can't style posts based on categories.

Hello @caraya,
this is an interesting point. In mostly all of my themes I use the post content type as default. However, this can be quite limiting if someone like you wants to use different content types.
To make things more flexible it would be grea to have a way to let the user decide in the config file which files should be included in the pagination. A simple array of strings should work fine. Now, I only need to find a way to merge all posts of wished content types.
I'll ask the fine folks at the Hugo forum. I search for a way that's both elegant and flexible (for you) at the same time.

You can find the corresponding discussion here.

The solution to this problem might come a bit late. But Hugo lately introduced .Site.Params.mainSections (see spf13/hugo#3206): a way to specify which types of pages are most important ones. Note that this feature is undocumented at the time I'm writing this. By default the list is filled with the section that has the most regular pages. But of couse you can specify your own sections.
In the upcoming version of this theme I'm using this variable to show all posts that are in one of the main sections. See 0928ac7. Stay tuned.


[WIP] On target ssl_client2 and mbed-os build environment

This PR partially implements on-target system testing (Jira IOTSSL-2336). It contains following:

Rebased on abstract-fs PR #1029
A script for building on-target ssl_client2 with mbed-os
on-target version of ssl_client2
frontend.c modified to accept arguments

Closing this PR as on-target testing was removed from Mbed TLS in PR #5116 (#4944 for 2.28 LTS), following the announcement in issue #4912 in Sep 2021.
A separate issue (#5595) has been raised as a placeholder, in case we want to come back to it at some point in the future.


Unable to load script after react-native upgrade from 0.71.7 to 0.72.3

Description
I'm getting this error after the RN upgrade.
React Native Version
0.72.3
Output of npx react-native info
System:
  OS: macOS 13.4.1
  CPU: (8) x64 Apple M1
  Memory: 19.50 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.15.0
    path<EMAIL_ADDRESS>  Yarn:
    version: 1.22.19
    path: /usr/local/Cellar/yarn/1.22.19/bin/yarn
  npm:
    version: 9.5.0
    path<EMAIL_ADDRESS>  Watchman:
    version: 2<IP_ADDRESS>
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /Users/user/.rvm/gems/ruby-2.7.4/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.2
      - iOS 16.2
      - macOS 13.1
      - tvOS 16.1
      - watchOS 9.1
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
    Build Tools:
      - 29.0.2
      - 29.0.3
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 32.0.0
      - 33.0.0
    System Images:
      - android-29 | Intel x86 Atom_64
      - android-31 | Google APIs ARM 64 v8a
      - android-32 | Google APIs ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.1 AI-221.6008.13.2211.9619390
  Xcode:
    version: 14.2/14C18
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.7.4
    path: /Users/user/.rvm/rubies/ruby-2.7.4/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.3
    wanted: 0.72.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce
Upgrade RN
Snack, code example, screenshot, or link to a repository

Could you provide more context? What have you done to try debugging, etc?

Could you provide more context? What have you done to try debugging, etc?

I don't have any detailed information except metro warns that No apps connected.
Maybe you could point me out the place of the possible issue? Or what can I do to get some useful information?

Have you searched on StackOverflow? There are plenty of answers to your specific question
https://stackoverflow.com/questions/55441230/unable-to-load-script-make-sure-you-are-either-running-a-metro-server-or-that-yo

@cortinico I guess, the issue might be with the metro.config.js file.
Here is what I have now:
/**
 * Metro configuration for React Native
 * https://github.com/facebook/react-native
 *
 * @format
 */

const { getDefaultConfig } = require('metro-config');

module.exports = (async () => {
  const {
    resolver: { sourceExts, assetExts },
  } = await getDefaultConfig();
  return {
    transformer: {
      babelTransformerPath: require.resolve('react-native-svg-transformer'),
      getTransformOptions: async () => ({
        transform: {
          experimentalImportSupport: false,
          inlineRequires: true,
        },
      }),
    },
    resolver: {
      assetExts: assetExts.filter((ext) => ext !== 'svg'),
      sourceExts: [...sourceExts, 'svg'],
    },
  };
})();

And here is the new config template (how it should look like after the upgrade):
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');

/**
 * Metro configuration
 * https://facebook.github.io/metro/docs/configuration
 *
 * @type {import('metro-config').MetroConfig}
 */
const config = {};

module.exports = mergeConfig(getDefaultConfig(__dirname), config);

Is there a way to modify the resolver in the new config file as I have in my previous one?


Distinct category types

Since the RSS <category> tag and the iTunes-style <ns:category text="..."> are substantially different (the iTunes-style ones can have a subcategory, the RSS ones can have a domain attribute), and need to be parsed and written differently, this PR creates two distinct classes to model the two kinds of category tags — RssCategory and ITunesStyleCategory, respectively.
Of course, this comes with updates to tests and models using them. There's some minor refactorings in there too, mostly grouping all DOM-related code in its own package.


JAX docs tutorial: How to think in JAX 101

@jakevdp

Please rebase against main and fix conflicts – thanks!

Thanks! Please squash the commits into a single commit (FYI if you used git rebase main rather then git merge main initially, it would have done this from the start)


electron app package error

I have updated electron package to 1.3.8 using npm install -g electron-prebuilt@latest version --save-dev and it was succesful. Now, when i use npm install, it runs succesfully (i hope, because a new command bar appears after some time). Now, when i run amp start command, this error shows:

Your install of electron broke / npm did something funky.
This happens occasionally and can be fixed by deleting the electron folder inside your node_modules folder and running npm install again.

Hi, @amanjobs have you tried @MarshallOfSound 's solution.
My issue has posted at #99
that is: After running for a while, npm ERR! code ELIFECYCLE
It start successfully. but will crash after a while(mostly one hour).
I'm going to try @MarshallOfSound 's solution out. See if things will work.

I've tried the solution

This happens occasionally and can be fixed by deleting the electron folder inside your node_modules folder and running npm install again.

My app still crash after running for a while due to the same error.

enter  \electron-quick-start\node_modules\electron
and then node install.js
and wait