WIP: Fix for using globs

This fixes issues with using globs for entity dirs

Click here for all of my investigation / rambling

0|server  | Error saving recipe TypeError: Cannot read property 'name' of undefined
0|server  |     at Function.className (/home/coder/project/packages/server/node_modules/mikro-orm/dist/utils/Utils.js:156:28)
0|server  |     at MongoConnection.getCollectionName (/home/coder/project/packages/server/node_modules/mikro-orm/dist/connections/MongoConnection.js:153:26)
0|server  |     at MongoConnection.getCollection (/home/coder/project/packages/server/node_modules/mikro-orm/dist/connections/MongoConnection.js:19:36)
0|server  |     at MongoConnection.insertOne (/home/coder/project/packages/server/node_modules/mikro-orm/dist/connections/MongoConnection.js:84:28)
0|server  |     at MongoDriver.nativeInsert (/home/coder/project/packages/server/node_modules/mikro-orm/dist/drivers/MongoDriver.js:33:32)
0|server  |     at ChangeSetPersister.persistEntity (/home/coder/project/packages/server/node_modules/mikro-orm/dist/unit-of-work/ChangeSetPersister.js:37:37)
0|server  |     at ChangeSetPersister.persistToDatabase (/home/coder/project/packages/server/node_modules/mikro-orm/dist/unit-of-work/ChangeSetPersister.js:20:20)
0|server  |     at UnitOfWork.commitChangeSet (/home/coder/project/packages/server/node_modules/mikro-orm/dist/unit-of-work/UnitOfWork.js:200:35)
0|server  |     at processTicksAndRejections (internal/process/task_queues.js:86:5)

I added a log for
https://github.com/B4nan/mikro-orm/blob/master/lib/connections/MongoConnection.ts#L181-L184
  private getCollectionName(name: EntityName<IEntity>): string {
    name = Utils.className(name);
    console.log(this.metadata)
    return this.metadata[name] ? this.metadata[name].collection : name;
  }

0|server  |   Recipe:
0|server  |    { properties:
0|server  |       { _id: [Object],
0|server  |         createdAt: [Object],
0|server  |         updatedAt: [Object],
0|server  |         name: [Object],
0|server  |         description: [Object] },
0|server  |      primaryKey: '_id',
0|server  |      path:
0|server  |       '/home/coder/project/packages/server/src/Recipe/entities/recipe.entity.ts',
0|server  |      name: 'Recipe',
0|server  |      constructorParams: [],
0|server  |      extends: undefined },

This fails because there is an entry in metadata for the entity, but the collection property isn't set.
Workaround? Maybe?
If I specify the collection on the entity
@Entity({ collection: "Recipe" })
export class Recipe {
//...

Here's the metadata now
0|server  |   Recipe:
0|server  |    { properties:
0|server  |       { _id: [Object],
0|server  |         createdAt: [Object],
0|server  |         updatedAt: [Object],
0|server  |         name: [Object],
0|server  |         description: [Object] },
0|server  |      primaryKey: '_id',
0|server  |      path:
0|server  |       '/home/coder/project/packages/server/src/Recipe/entities/recipe.entity.ts',
0|server  |      collection: 'Recipe',
0|server  |      name: 'Recipe',
0|server  |      constructorParams: [],
0|server  |      extends: undefined },

But then I get another error:
Error saving recipe TypeError: Cannot read property 'name' of undefined
0|server  |     at Function.fromMergeWithoutPK (/home/coder/project/packages/server/node_modules/mikro-orm/dist/utils/ValidationError.js:49:68)
0|server  |     at EntityValidator.validatePrimaryKey (/home/coder/project/packages/server/node_modules/mikro-orm/dist/entity/EntityValidator.js:55:43)
0|server  |     at EntityManager.merge (/home/coder/project/packages/server/node_modules/mikro-orm/dist/EntityManager.js:154:20)
0|server  |     at UnitOfWork.commitChangeSet (/home/coder/project/packages/server/node_modules/mikro-orm/dist/unit-of-work/UnitOfWork.js:203:17)
0|server  |     at processTicksAndRejections (internal/process/task_queues.js:86:5

https://github.com/B4nan/mikro-orm/blob/master/lib/entity/EntityValidator.ts#L66-L70
  validatePrimaryKey<T extends IEntityType<T>>(entity: EntityData<T>, meta: EntityMetadata): void {
    if (!entity || (!entity[meta.primaryKey] && !entity[meta.serializedPrimaryKey])) {
      throw ValidationError.fromMergeWithoutPK(meta);
    }
  }

Here's my entity (console.logged from EntityRepository#GetRepository) It doesn't have an _id, so it fails this check.
0|server  |   Recipe {
0|server  |   createdAt: 2019-08-01T17:09:13.160Z,
0|server  |   updatedAt: 2019-08-01T17:09:13.160Z,
0|server  |   name: 'My Recipe',
0|server  |   description: 'Some cool recipe Created:<PHONE_NUMBER>160' }

More Logs!!!
0|server  | Getting Unit of work:
0|server  | Insert one into :  Recipe string
0|server  | Get Collection Name for:  Recipe string
0|server  | Get Collection Name for classname:  Recipe string
0|server  | metdata:  true { BaseEntity:
0|server  |    { properties: { _id: [Object], createdAt: [Object], updatedAt: [Object] },
0|server  |      primaryKey: '_id',
0|server  |      path:
0|server  |       '/home/coder/project/packages/server/src/shared/entities/BaseEntity.ts' },
0|server  |   Recipe:
0|server  |    { properties:
0|server  |       { _id: [Object],
0|server  |         createdAt: [Object],
0|server  |         updatedAt: [Object],
0|server  |         name: [Object],
0|server  |         description: [Object] },
0|server  |      primaryKey: '_id',
0|server  |      path:
0|server  |       '/home/coder/project/packages/server/src/Recipe/entities/recipe.entity.ts',
0|server  |      collection: 'Recipe',
0|server  |      name: 'Recipe',
0|server  |      constructorParams: [],
0|server  |      extends: undefined },
0|server  |   User:
0|server  |    { properties:
0|server  |       { username: [Object],
0|server  |         allServices: [Object],
0|server  |         emails: [Object],
0|server  |         deactivated: [Object],
0|server  |         recipes: [Object] },
0|server  |      path:
0|server  |       '/home/coder/project/packages/server/src/User/entities/user.entity.ts',
0|server  |      name: 'User',
0|server  |      constructorParams: [],
0|server  |      extends: 'BaseEntity' } }
0|server  | CollectionName:  Recipe string
0|server  | Get Collection Name for:  Recipe string
0|server  | Get Collection Name for classname:  Recipe string
0|server  | metdata:  true { BaseEntity:
0|server  |    { properties: { _id: [Object], createdAt: [Object], updatedAt: [Object] },
0|server  |      primaryKey: '_id',
0|server  |      path:
0|server  |       '/home/coder/project/packages/server/src/shared/entities/BaseEntity.ts' },
0|server  |   Recipe:
0|server  |    { properties:
0|server  |       { _id: [Object],
0|server  |         createdAt: [Object],
0|server  |         updatedAt: [Object],
0|server  |         name: [Object],
0|server  |         description: [Object] },
0|server  |      primaryKey: '_id',
0|server  |      path:
0|server  |       '/home/coder/project/packages/server/src/Recipe/entities/recipe.entity.ts',
0|server  |      collection: 'Recipe',
0|server  |      name: 'Recipe',
0|server  |      constructorParams: [],
0|server  |      extends: undefined },
0|server  |   User:
0|server  |    { properties:
0|server  |       { username: [Object],
0|server  |         allServices: [Object],
0|server  |         emails: [Object],
0|server  |         deactivated: [Object],
0|server  |         recipes: [Object] },
0|server  |      path:
0|server  |       '/home/coder/project/packages/server/src/User/entities/user.entity.ts',
0|server  |      name: 'User',
0|server  |      constructorParams: [],
0|server  |      extends: 'BaseEntity' } }
0|server  | Merging Entity Recipe {
0|server  |   createdAt: 2019-08-01T17:27:29.960Z,
0|server  |   updatedAt: 2019-08-01T17:27:29.963Z,
0|server  |   name: 'My Recipe',
0|server  |   description: 'Some cool recipe Created:<PHONE_NUMBER>959',
0|server  |   __primaryKey: 5d4321011bb0124e0584efed }  With data undefined
0|server  | Entity Classname is  My Recipe string metadata:  false undefined
0|server  | Throwing merge without PK for entity undefined and Meta undefined
0|server  | Error saving recipe TypeError: Cannot read property 'name' of undefined
0|server  |     at Function.fromMergeWithoutPK (/home/coder/project/packages/server/node_modules/mikro-orm/dist/utils/ValidationError.js:49:68)
0|server  |     at EntityValidator.validatePrimaryKey (/home/coder/project/packages/server/node_modules/mikro-orm/dist/entity/EntityValidator.js:60:37)
0|server  |     at EntityManager.merge (/home/coder/project/packages/server/node_modules/mikro-orm/dist/EntityManager.js:164:20)
0|server  |     at UnitOfWork.commitChangeSet (/home/coder/project/packages/server/node_modules/mikro-orm/dist/unit-of-work/UnitOfWork.js:203:17)
0|server  |     at processTicksAndRejections (internal/process/task_queues.js:86:5)

Stack
It looks like that got us a little further (modified it in node_modules)
but now we get this error (again)
Error saving recipe TypeError: Cannot read property 'name' of undefined
    at Function.fromMergeWithoutPK (/home/coder/project/packages/server/node_modules/mikro-orm/dist/utils/ValidationError.js:49:68)
    at EntityValidator.validatePrimaryKey (/home/coder/project/packages/server/node_modules/mikro-orm/dist/entity/EntityValidator.js:55:43)
    at EntityManager.merge (/home/coder/project/packages/server/node_modules/mikro-orm/dist/EntityManager.js:139:24)
    at UnitOfWork.commitChangeSet (/home/coder/project/packages/server/node_modules/mikro-orm/dist/unit-of-work/UnitOfWork.js:192:25)
    at processTicksAndRejections (internal/process/task_queues.js:86:5)

This is called from
https://github.com/B4nan/mikro-orm/blob/master/lib/unit-of-work/UnitOfWork.ts#L240-L244
Conclusion 1
EntityManager#merge - When creating an entity with data only const recipe = await this.recipeRepository.create({ ...recipeInput, description }); it will be called with the data, which won't be an entity, which won't have an ID and will fail merge
Problem two
If I use new Recipe, Object.assign and then persistAndFlush, it correctly creates an ID in the __primaryKey property. But still doesn't work
Merging Entity Recipe {
0|server  |   createdAt: 2019-08-01T17:41:46.322Z,
0|server  |   updatedAt: 2019-08-01T17:41:46.325Z,
0|server  |   name: 'My Recipe',
0|server  |   description: 'Some cool recipe Created:<PHONE_NUMBER>322',
0|server  |   __primaryKey: 5d43245aec82af4f3c8a569c }  With data undefined
0|server  | Entity Classname is  My Recipe string metadata:  false undefined
0|server  | Throwing merge without PK for entity undefined and Meta undefined

const recipe = new Recipe();
    const description = recipeInput.description + " Created: " + Date.now();
    Object.assign(recipe, recipeInput, { description });
    // const recipe = await this.recipeRepository.create({ ...recipeInput, description });
    console.log("before persist and flush recipe", recipe, "typeof", typeof recipe);
    await this.recipeRepository.persistAndFlush(recipe);
    console.log("after persist and flush recipe", recipe);
    recipe.description = "goo";
    console.log("after set description recipe", recipe);
    try {
      await this.recipeRepository.persistAndFlush(recipe);
    } catch (e) {
      console.log("Error saving recipe", e);
    }
    console.log("Recipe Saved", recipe);
    return recipe;

Stack
persistAndFlush -> EntityManager#flush -> UnitOfWork#commit -> UnitOfWork$commitChangeSet -> ChangeSetPersister#persistToDatabase -< persistEntity#ChangeSetPersister -> MongoDriver#nativeInsert -> MongoConnection#insertOne -> MongoConnection#getCollectionName

Now we have undefined as the collection and we call two more lines, then we call this.getCollection with undefined

Which calls collectionName again, on undefined

which calls className on undefined name = utils_1.Utils.className(name);
Conclusion 2
getCollectionName fails if the metadata doesn't have a collection
Fixes?
I think the failure is correct. If you pass in undefined collection to getCollectionName it should probably fail.
But returning undefined from getCollectionName in the first place seems wrong. We should probably change this line from:
return this.metadata[name] ? this.metadata[name].collection : name;

to
return (this.metadata[name] && this.metadata[name].collection) ? this.metadata[name].collection : name;

or, IMO a little bit cleaner
return (this.metadata[name] && this.metadata[name].collection) || name;

But, the root cause might be, why is collection null in the first place??
More problems
Ugh.... Okay lets run the example in nestjs-mikro-orm. That seems to work for both SQLLite and mongodb.
What's the difference??
Version:
2.7.1
my version
2.7.4
okay, so let's try using 2.7.1....
We get an error because ./**/entities/ is not a directory... interesting, so glob patterns was added since 2.7.1??
So let's try an entities directory. If the only change I make is move recipe.entity.ts to an ./entities/ folder, it works perfectly....... UGH! So there's an issue with loading the files with globby.

First of all, please remove all code style changes so the diff is more readable (it looks like you applied some automatic formatter, right?). Also please stick to current project's code style (empty lines inside class definition, different style for constructors, do not add unnecessary brackets...).
There was some outage in travis, I just restarted the build, now it ended but a lot of tests are failing, so obviously please fix them all (and aim to keep the 100% code coverage).

Also please simplify those new entities. If you use them only for testing the entity discovery, then 2-3 simple entities should be enough, and there is no reason to have hooks and complex associations inside them.

Btw the reason why collection property was not set on given entity metadata is that is was not discovered properly. The metadata collection is first build based on decorators present in entities, and then all entities needs to be discovered based on entities/entitiesDirs options. In this process all default values will be handled (not just collection, but also stuff from naming strategy, etc).
This is the method that needs to be fired on all entities: https://github.com/B4nan/mikro-orm/blob/a41d1ec50c824dbc92478a63b35caa6d63fb0737/lib/metadata/MetadataDiscovery.ts#L83
If you enable debug mode and set logger (https://b4nan.github.io/mikro-orm/debugging/) you should probably see there are no entities discovered.

About your conclusions:

Conclusion 1
EntityManager#merge - When creating an entity with data only const recipe = await this.recipeRepository.create({ ...recipeInput, description }); it will be called with the data, which won't be an entity, which won't have an ID and will fail merge

You are mixing two things here. em.create() is there so you can programatically create entity instance.
// these 2 are equivalent
const recipe = await this.recipeRepository.create(...);
const recipe = new Recipe(...);

If you want to merge the recipe entity, you need to be sure it has ID. Not sure what exactly are you trying to achieve. Normally you construct the entity and persist it (then it becomes managed ~ merged). Using em.create() and em.merge() like this is usually only for restoring cached entity (so it has ID, and you need to make it managed ~ part of the identity map).

Conclusion 2
getCollectionName fails if the metadata doesn't have a collection

This is again because of the discovery process not passed thru the given entity. The method will always return a string if discovery happened, as collection property of metadata is always set. One exception is base entity I think, but that is invalid here (the method is never called on base entity).

More problems

globby was afaik added in v2.0.0, but its true I didn't have much time for maintaining the examples repository, will need to update all of them soon, but currently I am focusing on finishing v3 (#80) first.

What I am missing here is snippets where you call MikroORM.init(), as there is the problem - in the configuration.
Few more notes about the discovery process and the reason why it works like this:

we support also vanilla JS entities, where no decorators are used
by defining a decorator in the entity, it will automatically create a record in metadata dict
but JS entities won't have records there as they do not use decorators
TS entities could also not be initialized if they were not loaded into the memory (so decorators where never executed)

Thanks for all of the quick responses. Sorry that this is kinda a mess. Mostly this is a stab at fixing it for my use case. I'm sure it's not a great fix, and might break stuff for other use cases.

First of all, please remove all code style changes so the diff is more readable (it looks like you applied some automatic formatter, right?). Also please stick to current project's code style (empty lines inside class definition, different style for constructors, do not add unnecessary brackets...).
There was some outage in travis, I just restarted the build, now it ended but a lot of tests are failing, so obviously please fix them all (and aim to keep the 100% code coverage).

Yea, prettier... It's great in your own project, but when you work on an open source project it blows everything up. I should have put a WIP tag on this (added now), cuz style and tests that def needs to be fixed. I couldn't get the tests setup locally, so I was kinda leaning on Travis there.

Also please simplify those new entities. If you use them only for testing the entity discovery, then 2-3 simple entities should be enough, and there is no reason to have hooks and complex associations inside them.

For sure, again, I didn't get tests running locally, so I was stabbing in the dark a bit. I have mariadb (mysql compatible... right?), mongodb and postgres setup on my NAS, how can I run the tests against those DBs?

If you enable debug mode and set logger (https://b4nan.github.io/mikro-orm/debugging/) you should probably see there are no entities discovered.

Yea... I found this after a way, and it showed the Source file for entity ${file} not found, check your 'entitiesDirsTs' option message right away, which led me to the globs not loading correctly. Part of the problem too is that my Nest.js setup was suppressing the error message/stack, which made it harder. But even with either entitiesDirsTs set (to a glob, which it didn't support I guess) or not set, which I think should load the files from the tsConfig, it wouldn't boot up for me.

About your conclusions:

First off, like I said in my issue response, take this with a grain of salt. Conclusions is probably a strong word. I was mostly just trying to organize my thoughts.

If you want to merge the recipe entity, you need to be sure it has ID. Not sure what exactly are you trying to achieve. Normally you construct the entity and persist it (then it becomes managed ~ merged). Using em.create() and em.merge() like this is usually only for restoring cached entity (so it has ID, and you need to make it managed ~ part of the identity map).

Gotcha, I kept messing with stuff, so this was one iteration of that. But it sounds like it's meant to be used as:

Create instance of entity - new Recipe()
Modify it
Persist it recipeRepository.persist(recipe) (or entityManager)

What I am missing here is snippets where you call MikroORM.init(), as there is the problem - in the configuration.

I'm using nestjs-mikro-orm
app.module.ts
    MikroOrmModule.forRootAsync({
      useClass: AppMikroOrmOptions
    }),

MikroORMOptions.ts
import { MikroOrmOptionsFactory, MikroOrmModuleOptions } from "nestjs-mikro-orm";

export class AppMikroOrmOptions implements MikroOrmOptionsFactory {
  createMikroOrmOptions(): Promise<MikroOrmModuleOptions> | MikroOrmModuleOptions {
    return {
      type: "mongo",
      dbName: "goalsapp-dev",
      clientUrl: "mongodb://<IP_ADDRESS>",
      entitiesDirs: ["./**/entities"],
      entitiesDirsTs: ["./**/entities"],
      baseDir: __dirname,
      cache: {
        enabled: true, // This is required?
        options: {
          cacheDir: ".build/type-cache"
        }
      },
      debug: true
    };
  }
}

I'll try to get an example repo setup, but might be a few days.

Ok understood :] In the meantime I spent some time with making the linter more strict (already merged to master), so that should help you with the code style a bit once you rebase.
About tests, I would definitely go for docker, once you have it installed, then its just about booting up via docker-compose up -d (drop the -d during initial setup so you know it works). Its pretty easy to setup, even on windows it took me less than hour... And yes, it should be mariadb compatible, as the mysql driver states that too.
About your init snippet:

baseDir: __dirname, this part might be the problem, as you are using the current directory where the MikroORMOptions.ts file is stored as the base directory. If that is not the root of your project ~ if your entities are not stored in its subdirectories ~ then it can't work. By dropping this option, process.cwd() will be used as a default.
caching is enabled by default and you should be able to just change the cacheDir as options are deeply merged with defaults.

Strange that you did not get the source file missing error without the debug mode enabled. Would be good to get to the bottom of this as well.
BTW what I do like in your PR is that support for both relative and absolute paths 👍 Maybe I would suggest to split this into multiple PRs, one for support of absolute paths, another for using globs (+ possibly more). Try to be granular as possible, as the PR will get squashed and only 1 commit message will be there. That commit message will be part of the changelog, so it should be informative as possible.

Ok understood :] In the meantime I spent some time with making the linter more strict (already merged to master), so that should help you with the code style a bit once you rebase.

Nice!

About tests, I would definitely go for docker, once you have it installed, then its just about booting up via docker-compose up -d (drop the -d during initial setup so you know it works). Its pretty easy to setup, even on windows it took me less than hour... And yes, it should be mariadb compatible, as the mysql driver states that too.

The only issue with this is that I do most of my dev inside of a coder/code-server docker container on my home server (docker rocks! lol). I can probably just fire it up on my laptop or on the host of my home server to test it though. That's awesome that you have the docker-compose ready to go!

Speaking of tests, I would like to see this problem covered with unit tests instead of booting up the whole ORM. It can be pretty slow (seconds), so testing multiple configurations might end up being +1 min on tests easily, which is bad. This should be easy to extract and test only the lookup mechanism. Another problematic part will be with entity names. Currently it is required that all entities names are unique as the metadata storage is global (it needs to be because of how decorators work). I would love to find a way around this but that is another story...

I agree. If I can get the tests running locally this would all be a lot easier to do with tests (TDD).
Have you considered splitting the tests between unit tests and E2E/integration, or whatever you want to call it?

About your init snippet:

baseDir: __dirname, this part might be the problem, as you are using the current directory where the MikroORMOptions.ts file is stored as the base directory. If that is not the root of your project ~ if your entities are not stored in its subdirectories ~ then it can't work. By dropping this option, process.cwd() will be used as a default.

I think this breaks down if I run from the base of my lerna repo though. I think there's a way around that though. I'll look into that.

caching is enabled by default and you should be able to just change the cacheDir as options are deeply merged with defaults.

...This works fine now if I comment out enabled. Why wouldn't it before? Ugh...

Strange that you did not get the source file missing error without the debug mode enabled. Would be good to get to the bottom of this as well.

Again, maybe I did, but nest was hiding it. I can test this by falling back to the released version.

BTW what I do like in your PR is that support for both relative and absolute paths 👍 Maybe I would suggest to split this into multiple PRs, one for support of absolute paths, another for using globs (+ possibly more).

It seems easiest if we, right at the beginning convert everything to absolute, it makes things a lot easier IMHO.

Try to be granular as possible, as the PR will get squashed and only 1 commit message will be there. That commit message will be part of the changelog, so it should be informative as possible.

For sure. Also conventional commits are awesome. I had just started using them before starting this PR.
More of a high level, does this change make sense? I think I need to create a minimum representation of the issue (with and without nest maybe?) to test against and verify that it's an issue that you actually want to fix.

More of a high level, does this change make sense? I think I need to create a minimum representation of the issue (with and without nest maybe?) to test against and verify that it's an issue that you actually want to fix.

Yeah I think it does make sense, if I understood it correctly. Still it might be much easier to use the approach with doing lookup yourself and passing the array of entities instead.
Example project with the issue would be great. Nest is fine I think, I am familiar with it as I do use it as well in my projects.

Example project with the issue would be great. Nest is fine I think, I am familiar with it as I do use it as well in my projects.

Here's a reproduction repo. https://github.com/NickBolles/mikro-orm-globby-issue
If you have time, I'd appreciate you making sure I'm no doing anything dumb lol.

Thanks for the repo, first thing that is not 100% correct (although it should be working) is your setup of entitiesDirs. As you mentioned, thanks to globby, it should work fine, but generally you want to have it more specific. In your example, your source files will always be under src, and compiled files under dist, so it should be something like:
    MikroOrmModule.forRoot({
      entitiesDirs: ["./dist/**/entities"],
      entitiesDirsTs: ["./src/**/entities"],

Also note that by default, entitiesDirsTs is optional and if not provided entitiesDirs is used, so having those two with equal value is not needed.
I also believe that the problem here is the baseDir option, as you are putting there current directory, which should be src if run via ts-node, and probably dist if compiled and run via node. Try to comment that out, then the default process.cwd() will be used from where above settings (with dist and src) should work.
Also I saw you are using @Property({ default: callback }), that is afaik not supported, it is meant only for schema generator and it should be scalar value that will be used as sql default for given column.

Thanks for the repo, first thing that is not 100% correct (although it should be working) is your setup of entitiesDirs. As you mentioned, thanks to globby, it should work fine, but generally you want to have it more specific. In your example, your source files will always be under src, and compiled files under dist, so it should be something like:
    MikroOrmModule.forRoot({
      entitiesDirs: ["./dist/**/entities"],
      entitiesDirsTs: ["./src/**/entities"],

Also note that by default, entitiesDirsTs is optional and if not provided entitiesDirs is used, so having those two with equal value is not needed.
I also believe that the problem here is the baseDir option, as you are putting there current directory, which should be src if run via ts-node, and probably dist if compiled and run via node. Try to comment that out, then the default process.cwd() will be used from where above settings (with dist and src) should work.

I guess I'm confused by this. If we are running from ts-node, the src/app.module.ts file will be running, and __dirname should be the src/ directory. If we have compiled and running dist/app.module.js the __dirname should be the dist/ directory. Either way, you are starting from the same point and doing a glob from src or dist, which IMO is how it should be. I preferrably want my compiled app to be self contained (so basically src folder down can compile to js and then just use package.json, npm inistall and node app.js to run) Although for node apps it's a bit of a futile effort.
Updated the repo with these changes though.

Also I saw you are using @Property({ default: callback }), that is afaik not supported, it is meant only for schema generator and it should be scalar value that will be used as sql default for given column.

Yea should have left that out, was messing with it. Oops. removed

The thing is that (if not run via ts-node), ORM needs to know both paths, as it has to be able to locate the TS source files (for sniffing all the types correctly). So if compiled and run via node, then you will get the baseDir set to dist, from where you can't find those TS source files as they live one step above. The fallback is to use tsconfig.json, and again, if you setup baseDir this way, even the tsconfig.json won't be found.

The thing is that (if not run via ts-node), ORM needs to know both paths, as it has to be able to locate the TS source files (for sniffing all the types correctly). So if compiled and run via node, then you will get the baseDir set to dist, from where you can't find those TS source files as they live one step above. The fallback is to use tsconfig.json, and again, if you setup baseDir this way, even the tsconfig.json won't be found.

Gotcha, so Typescript is required in production for Mikro-ORM? Is there a way we can compile the types? Basically it would be dumping the cache into the dist folder, right? sot hat we don't need typescript in production?
This also seems like a tangent. Don't want to get stuck on this. I'll update the PR tonight with styling and test changes.

It's not required, you can still specify types manually in decorators, only those that are missing will be sniffed via reflection. Also you do not need "TS in production", you just need TS source files deployed so they can be analysed (via ts-morph). I personally do deploy TS files, as it's server side thing, it does not matter much so I am fine with that approach. But if you specify all types then this whole process will be skipped.
You can also use MikroORM with vanilla JS, and specify the schema manually https://b4nan.github.io/mikro-orm/usage-with-js/.

Where are we with this one? I am not going to merge new features in v2 (master branch), so I guess we can close this one and if you want to implement this, please base it on current dev branch.
Still, I would rather see discussion in an issue prior to implementation, so we can agree what it should do.


when's behaviour question

Hi all,
We've been playing with when for a while and got thinking as to whether the wrapper could actually be removed when going to the view itself.
So instead of wrapping whatever my store's object is, just append a status field to it of some kind. I'm sure there are some reasons why it's done this way. However I wanted to see if anybody else thought about it as well and if it would make sense to return an unwrapped object rather than a wrapped one.
Thanks :)

not sure I follow. when is just a convenience function so you don't have to do this
var user = UserStore.getUser(123);

if (user.status === "pending") {
  console.log('waiting for user');
}

if (user.status === "error") {
  console.log('failed to get user', user.error);
}

if (user.status === "done") {
  console.log(user.result);
}

We've found its really handy when you're render function needs to handle the various states


Problems hosting under IIS using Azure/IISNode

I'm trying to run verdaccio under iisnode. OS is Windows Server 2012, NodeJS 8.11.1.
I get the following error when I visit the home page in a browser:
iisnode encountered an error when processing the request.
HRESULT: 0x2
HTTP status: 500
HTTP subStatus: 1002
HTTP reason: Internal Server Error
You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.
In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.
The last 64k of the output generated by the node.exe process to stderr is shown below:
Application has thrown an uncaught exception and is terminated:
Error: "audit" plugin not found
try "npm install verdaccio-audit"
    at D:\verdaccio\01-dev\html\node_modules\verdaccio\src\lib\plugin-loader.js:60:13
    at Array.map (<anonymous>)
    at load_plugins (D:\verdaccio\01-dev\html\node_modules\verdaccio\src\lib\plugin-loader.js:34:51)
    at module.exports (D:\verdaccio\01-dev\html\node_modules\verdaccio\src\api\index.js:89:19)
    at afterConfigLoad (D:\verdaccio\01-dev\html\node_modules\verdaccio\src\lib\cli.js:118:15)
    at Object.<anonymous> (D:\verdaccio\01-dev\html\node_modules\verdaccio\src\lib\cli.js:69:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

I've installed verdaccio-audit as suggested and the error changes to:
iisnode encountered an error when processing the request.
HRESULT: 0x2
HTTP status: 500
HTTP subStatus: 1002
HTTP reason: Internal Server Error
You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.
In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.
The last 64k of the output generated by the node.exe process to stderr is shown below:
Application has thrown an uncaught exception and is terminated:
Error: "audit" doesn't look like a valid plugin
    at D:\verdaccio\01-dev\html\node_modules\verdaccio\src\lib\plugin-loader.js:65:13
    at Array.map (<anonymous>)
    at load_plugins (D:\verdaccio\01-dev\html\node_modules\verdaccio\src\lib\plugin-loader.js:34:51)
    at module.exports (D:\verdaccio\01-dev\html\node_modules\verdaccio\src\api\index.js:89:19)
    at afterConfigLoad (D:\verdaccio\01-dev\html\node_modules\verdaccio\src\lib\cli.js:118:15)
    at Object.<anonymous> (D:\verdaccio\01-dev\html\node_modules\verdaccio\src\lib\cli.js:69:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

To Reproduce
Add the following files in the home directory
start.js:
`process.argv.push('-l', 'unix:' + process.env.PORT, '-c', './config.yaml');
require('./node_modules/verdaccio/src/lib/cli.js');`

package.json:
`{
  "name": "iisnode-verdaccio",
  "version": "1.0.0",
  "description": "Hosts verdaccio in iisnode",
  "main": "start.js",
  "dependencies": {
    "verdaccio": "^2.7.4"
  }
}`

Web.config
`<configuration>
  <system.webServer>
    <modules>
        <remove name="WebDAVModule" />
    </modules>

    <!-- indicates that the start.js file is a node.js application
    to be handled by the iisnode module -->
    <handlers>
            <remove name="WebDAV" />
            <add name="iisnode" path="start.js" verb="*" modules="iisnode" resourceType="Unspecified" />
            <add name="WebDAV" path="*" verb="*" modules="WebDAVModule" resourceType="Unspecified" requireAccess="Execute" />
    </handlers>

    <rewrite>
      <rules>

        <!-- iisnode folder is where iisnode stores it's logs. These should
        never be rewritten -->
        <rule name="iisnode" stopProcessing="true">
          <match url="iisnode*" />
          <action type="None" />
        </rule>

        <!-- Rewrite all other urls in order for verdaccio to handle these -->
        <rule name="verdaccio">
          <match url="/*" />
          <action type="Rewrite" url="start.js" />
        </rule>
      </rules>
    </rewrite>

    <!-- exclude node_modules directory and subdirectories from serving
    by IIS since these are implementation details of node.js applications -->
    <security>
      <requestFiltering>
        <hiddenSegments>
          <add segment="node_modules" />
        </hiddenSegments>
      </requestFiltering>
    </security>

  </system.webServer>
</configuration>`

Expected behavior
Get verdaccio home page
Configuration File (cat ~/.config/verdaccio/config.yaml)
#
# This is the default config file. It allows all users to do anything,
# so don't use it on production systems.
#
# Look here for more config file examples:
# https://github.com/verdaccio/verdaccio/tree/master/conf
#

# path to a directory with all packages
storage: ./storage
# path to a directory with plugins to include
plugins: ./plugins

web:
  # WebUI is enabled as default, if you want disable it, just uncomment this line
  #enable: false
  title: Dev - Verdaccio

auth:
  htpasswd:
    file: ./htpasswd
    # Maximum amount of users allowed to register, defaults to "+inf".
    # You can set this to -1 to disable registration.
    #max_users: 1000

# a list of other known repositories we can talk to
uplinks:
  npmjs:
    url: https://registry.npmjs.org/

packages:
  '@*/*':
    # scoped packages
    access: $all
    publish: $authenticated
    proxy: npmjs

  '**':
    # allow all users (including non-authenticated users) to read and
    # publish all packages
    #
    # you can specify usernames/groupnames (depending on your auth plugin)
    # and three keywords: "$all", "$anonymous", "$authenticated"
    access: $all

    # allow all known users to publish packages
    # (anyone can register by default, remember?)
    publish: $authenticated

    # if package is not available locally, proxy requests to 'npmjs' registry
    proxy: npmjs

# To use `npm audit` uncomment the following section
middlewares:
  audit:
    enabled: true

# log settings
logs:
  - {type: stdout, format: pretty, level: http}
  #- {type: file, path: verdaccio.log, level: info}

Debugging output

$ NODE_DEBUG=request verdaccio display request calls (verdaccio <--> uplinks)
Doesn't work in Windows Powershell

$ DEBUG=express:* verdaccio enable extreme verdaccio debug mode (verdaccio api)
Doesn't work in Windows Powershell

 - `$ npm -ddd` prints:
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   '-ddd' ]
npm info using<EMAIL_ADDRESS>npm info using<EMAIL_ADDRESS>
Usage: npm <command>

where <command> is one of:
    access, adduser, bin, bugs, c, cache, completion, config,
    ddp, dedupe, deprecate, dist-tag, docs, doctor, edit,
    explore, get, help, help-search, i, init, install,
    install-test, it, link, list, ln, login, logout, ls,
    outdated, owner, pack, ping, prefix, profile, prune,
    publish, rb, rebuild, repo, restart, root, run, run-script,
    s, se, search, set, shrinkwrap, star, stars, start, stop, t,
    team, test, token, tst, un, uninstall, unpublish, unstar,
    up, update, v, version, view, whoami

npm <command> -h     quick help on <command>
npm -l           display full usage info
npm help <term>  search for help on <term>
npm help npm     involved overview

Specify configs in the ini-formatted file:
    C:\Users\davidw\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

<EMAIL_ADDRESS>C:\Program Files\nodejs\node_modules\npm

$ npm config get registry prints:

https://registry.npmjs.org/
Additional context
Add any other context about the problem here.

It seems you are using ^2.7.4 why?
verdaccio-audit was relased with verdaccio3, I doubt will work with any 2.x. We do not provide support for 2.x versions anymore.

Thanks, because this page https://verdaccio.org/docs/en/iss-server!
Update package.json to reference verdaccio ^3.0.0 helps.
The other problem I found was in Web.config the iisnode handler line shouldn't have requireAccess="Execute" (on Windows 2012 anyway) and the resourceType attribute isn't needed.
It should look as follows:
<add name="iisnode" path="start.js" verb="*" modules="iisnode" />
Startup.js should look like:
process.argv.push('-l', 'unix:' + process.env.PORT, '-c', './config.yaml'); require('./node_modules/verdaccio/build/lib/cli.js');
I'm using a localised config


Ram Mem consumption

I have 8 Gb of ram memory, and somethimes, the visual studio code consumes almost 40% of my memory, crashing my pc many times per day. When you guys will fix this issue?

/needsMoreInfo
Please provide more details. At lease output of code --status in console (please note that it contains paths and folder names etc. that you might want to redact first).


Add Category to the Blog Post in the Form

Hello, i would like to add Categories to the Posts. For that i have the following Many-To-Many Relationship added to the Post Model:
class Post(db.Model):
   #...
   categories = db.relationship('Category',
                             secondary=has_category,
                             backref=db.backref('posts', lazy='dynamic'),
                             lazy='dynamic')

 class Category(db.Model):
    __tablename__ = 'category'
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(64), unique=True, index=True)

has_category = db.Table('has_category',
                    db.Column('category_id', db.Integer, db.ForeignKey('category.id')),
                    db.Column('post_id', db.Integer, db.ForeignKey('post.id')))

Then i have changed the main/forms.py file and added a SelectField to the PostForm
class PostForm(FlaskForm):
    body = PageDownField("What's on your mind?", validators=[Required()])
    category = SelectField('Category', coerce=int)
    submit = SubmitField('Submit')

    def __init__(self, user, *args, **kwargs):
        super(PostForm, self).__init__(*args, **kwargs)
        self.category.choices = [(category.id, category.name)
                             for category in Category.query.order_by(category.name).all()]

The Categories are then displayed in the Select Field like it should.
Now I would like to give the User the option to add New Categories while creating a Blogpost. I have created a new view and a new html File to outsource the Post Creation from the Index.html. In that Html This template looks like the following:
{% block page_content %}

Add a new Post

        <form action="#" method="post">
            {{ form.csrf_token }}
            {{ form.body.label }} {{ form.body }}
            {{ form.category.label }} {{ form.category}}
            <button>Add</button>
            <input type="submit" value="Go">
        </form>

{% endblock %}

The Click on the Add Button should prompt the User for the name of the new Category, add it to the Database and update the Select Field to display the newly added Category.
But how can i archive this? Is there a solution without Javascript?
I hope this is the right Place to ask for help.

But how can i archive this? Is there a solution without Javascript?

I can think of three options, with only one being JavaScript first.
The first and possibly the best option, is to implement the category addition as an Ajax request. The browser will not need to reload the page, so the blog post form stays the same. So on the server you will have a new route to add a category, which you will invoke in JavaScript from the browser as a response to the click of the Add button.
Second option is to implement a separate form for adding a category. Then you can use standard form processing, without the need for JavaScript. The problem with this approach is that the contents of the blog post form will be erase as the browser switches pages, so for this option I would add some JavaScript that saves the contents of the form, so that they can be restored when the user returns to the blog post form.
The last option is to make the category field a test entry field, and remove the Add button. The blog post form on the server can look at the category, and add it automatically if it is not already in the database. This is the only option that is fully JavaScript free.

Many thanks for your reply. I have solved it now with your first mentioned option but instead of the Add Button i have made the Category a normal StringField and get the Categories via an AJAX request. Then i use the JQuery Autocomplete Feature for the Textfield.
This is my Javascript Part:
$(function () {
    $.post('/get-category').done(function (category) {
        $("#category").autocomplete({
            source: category['category']
        });
    })
});

The need view looks like this:
@main.route('/get-category', methods=['GET', 'POST'])
@login_required
def get_category():
    return jsonify({
        'category': [category.name for category in Category.query.order_by(Category.name).all()]
    })

Great. Glad you figured it out!


fix DeviceArray.repr for complex dtypes, test

c.f. #666

Tests pass locally, so I'm going to risk it and merge!


Why 'use strict' is not present in the library

I was wondering why none (maybe many) of the files don't have 'use strict'. What is the advantage and disadvantage of using 'use strict' in our library.
If you consider a silly question, am okay to have this closed yet I will be happy to have an answer to this a JS community question.

https://github.com/ramda/ramda/blob/master/dist/ramda.js#L8

Yes, it's in the dist version.  For a long time that was the only thing we cared about.  I don't know how important it might be to include it in every file.  Care to make an argument for it, @yesprasad?

@CrossEye @henriklundgren Thank you so much for the reply. I have checked in my application from which file the functions are called from - and they are from 'dist/ramda.js'. As this is the file and it has 'use strict' there should never be a worry. I am starting up trying to understand and contribute to open source.


Fix: cd ROOT_DIR/earth-forecasting-transformer

Change cd ROOT_DIR/earthformer to cd ROOT_DIR/earth-forecasting-transformer in all README.md

@gaozhihan Have we scanned the whole repo?

@gaozhihan Have we scanned the whole repo?

Yes. Previous fix #12 only fixed the main README. This PR fixes all remaining occurrences.


[Mjcf-parsing]: should handle multiple-joints as planar if appropriate

There's currently missing support to handle the case of multiple joints in the root body. Most models implement the planar case 1 hinge, 2 slide, but should add logs to let the user know of models that are not valid|supported.

Fixed by a05750f


bug: The rendering of the elements hidden behind the keyboard is delayed while scrolling and then appears when scrolling stops.

Bug Report
Ionic version:

[x] 4.x
Current behavior:
If I have a row of images (or even a div with a gradient) that is offscreen/behind the keyboard when I scroll down (or up) to it, they do not render properly when the keyboard minimizes. The elements do not appear until I lift my finger off the screen or when the scroller finishes all its animations.
This is causing a super noticeable problem for me, making the whole thing look choppy. Is there any way in which I can prevent this choppy-ness from happening?
Here is a gif of the issue.

Expected behavior:
The expected behavior is for the elements behind the keyboard to quickly render and appear on the screen when the keyboard minimizes.

I am having this issue.
In the Template:
`<ion-content
[scrollEvents]="true"
(ionScrollStart)="closeKeyboard();"

`

In the .TS
 closeKeyboard() {     try {       Keyboard.hide();     } catch (error) {}   }
It goes black like in the GIF above and seems like it's actually closing on scrollend? Am I implementing the desired action incorrectly or could it be an issue with the scroll event firing timing with the keyboard?

We were able to work around this by using touchstart instead.
<ion-content (touchstart)="closeKeyboard()">
with
closeKeyboard() {Keyboard.hide();}
Although, this created an issue with inner ion-content click events so we ended up modifying it to trigger the keyboard close by losing focus on the ion-searchbar. (It would be useful to have exposed a setBlur() event like the existing setFocus()) We implemented a "setBlur()" by creating a function:
loseFocus() {     const activeElement = <HTMLElement>document.activeElement;     if (activeElement && activeElement.blur) {       activeElement.blur();     }   }
inspired by this solution: https://forum.ionicframework.com/t/dismiss-keyboard-on-touch-outside-it/66998/4?u=grabitadmin
We then just set the (touchstart)="loseFocus()" and placed it in a closer encapsulating div to reduce any conflicts. If you implement this, I would recommend directly addressing the input or searchbar instead of doing it globally like this -- it just happened to be the case that this doesn't cause any conflicts in our situation.

Thanks for the issue. Is this still an issue with the latest version of Ionic Framework? If so, please provide a repo with the code required to reproduce this issue.


Leading and trailing spaces are not stripped prior to writing to the database

Last night, I was prototyping with the DOI values returned by the portal API and noticed that one collection has a DOI with a leading space:

'Evolution of cellular diversity in primary motor cortex of human, marmoset monkey, and mouse'
' https://doi.org/10.1101/2<IP_ADDRESS>972'

I created a collection in staging with leading white spaces in multiple text fields.
The response from the API demonstrates that the leading spaces were not stripped:
{
    "contact_email": "<EMAIL_ADDRESS>    "contact_name": "    contact name with space",
    "description": "    description with space",
    "links": [
       {
            "link_name": "",
            "link_type": "DOI",
            "link_url": "     https://doi.org/withspace"
        }
    ],
    "name": "    collection with space"
}

We should not require our API users to add a string.strip() for such cases.
Definition of Done
The cleaning to strip whitespace should be done on the backend prior to committing the values to the database.
Any current cases in the database should be corrected.

@ebezzi how to check staging version?

Confirmed this is in staging. I also did some preliminary QA on Brian's collection and it seems to be working as expected.


NRE on IncludeCompiler.IncludeLoadTreeNodeBase

I'm getting an NRE when executing a .SingleAsync() query with a few navigational property includes.  This worked as expected in EF Core 1.1, but throws with the nightly EF 2.0 bits.
The query is something like the following...
await dbContext.Foos
                .Include(x => x.Bar).ThenInclude(x => x.Bazs)
                .SingleAsync(x => x.Id == id);

For this model, Bar is an optional navigational property on Foo and Bazs is a collection navigation property.  The logs show the generated sql query for fetching foo/Bar being generated, but the exception gets thrown on the join with Bazs. If the .ThenInclude(x => x.Bazs) is removed, it works fine.
fail: Microsoft.EntityFrameworkCore.Query[100100]
      An exception occurred in the database while iterating the results of a query for context type 'CustomDbContext'.
      System.NullReferenceException: Object reference not set to an instance of an object.
         at Microsoft.EntityFrameworkCore.Query.Internal.IncludeCompiler.IncludeLoadTreeNodeBase.<_AwaitMany>d__8.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at Microsoft.EntityFrameworkCore.Query.Internal.IncludeCompiler.<_IncludeAsync>d__18`1.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at Microsoft.EntityFrameworkCore.Query.ExpressionVisitors.Internal.TaskLiftingExpressionVisitor.<_ExecuteAsync>d__8`1.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.AsyncSelectEnumerable`2.AsyncSelectEnumerator.<MoveNext>d__3.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at System.Linq.AsyncEnumerable.<Single_>d__380`1.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.TaskResultAsyncEnumerable`1.Enumerator.<MoveNext>d__3.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at System.Linq.AsyncEnumerable.SelectEnumerableAsyncIterator`2.<MoveNextCore>d__7.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at System.Linq.AsyncEnumerable.AsyncIterator`1.<MoveNext>d__10.MoveNext()
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.<MoveNext>d__5.MoveNext()

Further technical details
EF Core version:
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system:
IDE: (e.g. Visual Studio 2017)

Same error here with the same scenario
xception: System.NullReferenceException: Object reference not set to an instance of an object.    at Microsoft.EntityFrameworkCore.Query.Internal.IncludeCompiler.IncludeLoadTreeNodeBase.<_AwaitMany>d__8.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.EntityFrameworkCore.Query.Internal.IncludeCompiler.<_IncludeAsync>d__181.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.EntityFrameworkCore.Query.ExpressionVisitors.Internal.TaskLiftingExpressionVisitor.<ExecuteAsync>d__81.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.AsyncSelectEnumerable2.AsyncSelectEnumerator.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Linq.AsyncEnumerable.<FirstOrDefault>d__1651.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.TaskResultAsyncEnumerable1.Enumerator.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Linq.AsyncEnumerable.SelectEnumerableAsyncIterator2.<MoveNextCore>d__7.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at System.Linq.AsyncEnumerable.AsyncIterator1.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor1.EnumeratorExceptionInterceptor.<MoveNext>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<ExecuteSingletonAsyncQuery>d__231.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()    at SNOP.SIPPE.Business.Services.ProjectBusinessService.<GetByAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at SNOP.SIPPE.API.GP.Controllers.ProjectController.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__12.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Builder.RouterMiddleware.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.d__6.MoveNext()
`

@maumar It seems possible that this and #9449 are duplicates for the same underlying cause as #9038. Can you check this?

dupe of #9038


Template and view support

Currently, if you want to have view and template support you need to either piggyback off of Phoenix or roll your own. I think it makes sense for Swoosh to provide a mechanism for rendering templates for those of us not using Phoenix.
I could see this being part of Swoosh proper or as a separate package under the Swoosh organization.
The implementation could look similar to Phoenix's template and view implementations. Provide a Swoosh.Template.Engine behaviour for template engines to implement against (i.e. Swoosh.Template.EExEngine). Also, provide render, render_to_text and render_to_html functions as part of a Swoosh.View module or add these to Swoosh.Email. If you'd like we can think through the implementation together.
Let me know what you think. I think I can throw this together relatively quickly. If this isn't something Swoosh cares about I can just do this independently. I'd prefer Swoosh to endorse the effort so it can get broader community support.

I think it's a great idea!
Ping @stevedomin

Hi @anthonator, this is a great idea!
As you said, right now we only piggyback on Phoenix but I wanted to add support for Smoothie for a long time.
We'd love your contribution on that front. Let me know if I can be of any help.

Great! Excited to get started!
How do you want to do this from an organizational perspective? Do you think it makes sense for this to be part of Swoosh proper or a different library?
Also, I'd like to add a :template_engines config. How would you like to do this? We could add it as part of the current mailer config. We could also make it it's own config (this is how Phoenix does it).
An example for the second option:
config :swoosh, :template_engines,
  eex: Swoosh.Template.EExEngine


Spec and configure

Addresses Issue #4
Allows user to configure a secret that is appended to the Hashids salt, so that ids can be truly unique by site.
Also includes specs for the base encoded_id and decode_id methods as well as the new Hashid::Rails.configure method.

@emurphy Sorry for the delayed response! I missed seeing the notifications. This looks great! And glad to get some specs on the repo. Haven't had any time to improve on it since creating it earlier this year.


IGAPP-499: Improve no internet connection error

This pull request belongs to an issue on our bugtracker.
You can find it there by looking for an issue with the key which is mentioned in the title of this pull request.
It starts with the keyword IGAPP.

Some new translations might be needed (see comment on the issue tracker)


Fixed compatibility with struct

See https://github.com/hgrecco/pyvisa/issues/149

This might be fixed in the latest pyvisa (from pypi) and pyvisa-py (from github) Can you update both?

Hi,
I found a solution which solves the problem. I installed python-ivi and its extension python-vxi11, which allows to control instruments over Ethernet. Now I can very simply communicate with my Analyzer. Thank you for your help,
Bye

Lets port that solution to pyvisa-py

Fixed with #31

Hi enzo96
I'm working on the same project that you. Have you been able to automate the antenna rotator in order to make radiance diagrams measurments using the raspberry pi ? Because I have some issues related with NI-VISA. And my problem is that I can't install it on raspberry.
what have you done to install it ?


add brightness controls

Closes #860
Example:

Wow looks a cool feature

Looked good and tested without issues


Check the returned values of custom javascript functions

We had a custom JS function which produced a list of lists of numbers, but said it was returning a vector. The wrapper round custom javascript functions created in the question context (not built-ins or those added by extensions) should check that the returned value has the declared type.

I think this is fixed by making TVector (and TMatrix while I'm thinking about this) check that the value it's given has the right type.


RoaringBitmap#intersects breaks for lower minumum values

Describe the bug
When the difference between the lowest value in the bitmap and the minimum passed to intersects function is higher than a threshold, it retruns wrong values.
To Reproduce
import org.roaringbitmap.RoaringBitmap;

public class App {
    public static void main(String[] args) {
        int valueInBitmap = 27470832;
        int baseValue = 27597418;
        int minValueThatWorks = 27459584;

        RoaringBitmap bitmap = RoaringBitmap.bitmapOf(valueInBitmap);

        System.out.println(bitmap.intersects(minValueThatWorks, baseValue)); // Returns true. Ok
        System.out.println(bitmap.intersects(minValueThatWorks-1, baseValue)); // Returns false. Not Ok
    }
}

I think one of the problems is around container.intersects(offset, 1 << 16). If I understood things correctly, this test is not necessarily correct when the minimum key is on a different container than the one at pos. Maybe an early test could be added if there's an intersection on key level. In this case, minimum is in bucket 418, the value of the bitmap is in bucket 419 and supremum is in key 421.
  while (pos < length && supKey > (keys[pos])) {
      Container container = highLowContainer.getContainerAtIndex(pos);
      if (container.intersects(offset, 1 << 16)) {
        return true;
      }
      offset = 0;
      ++pos;
    }

https://github.com/RoaringBitmap/RoaringBitmap/blob/master/RoaringBitmap/src/main/java/org/roaringbitmap/RoaringBitmap.java#L1197`
RoaringBitmap version:
0.9.33
Java version:
11

You are correct. This looks like a straight-forward bug.

Just saw your PR, I think the same bug is also present for ImmutableRoaringBitmap  too
https://github.com/RoaringBitmap/RoaringBitmap/blob/master/RoaringBitmap/src/main/java/org/roaringbitmap/buffer/ImmutableRoaringBitmap.java#L1239

@igorcalabria Correct. I am issuing a second release with the same fix extended.


Expose details within wamp_invocation_impl

Exposed the details sent with the WAMP invocation so that they may be read by the client hosting the procedure.
They are stored in the wamp_invocation_impl as a msgpack object and exposed as a map, using the same access style as the methods that access the keyword arguments. The details member is set using the set_details method, which also sets the URI and progressive results flag.

In hindsight, I should have probably added additional accessors that mirror kw_argument(const std::string& key), et.al.; I guess my thinking was the use case for needing to get the invocation details was pretty limited, so I didn't add them.

Thanks for contributing!


Fix maximum number of outputs

Issue Number

N/A
Overview

[ ] I have fixed the "maximum number of outputs" constant in Jörmungandr which actually is 254

Comments

:man_shrugging:

bors r+

bors retry

bors r+


Add TypeScript definitions to NPM package

Adds definitions for all exported functions from the secrets.js exported module.
I have included the exposed internal functions (beginning with _). If you prefer that these were not part of the exported typings, I will remove them

Thanks for the pull request.  Sorry for the delay.

No worries, cheers!


No more action from zwavejs2mqtt to my iot devices

Dear,
Since xxx days (not really knows how many :(), I'm not able to switch on/off my iot devices. I received the informations from the device to home assistant via zwavejs but I can not turn on/off my iot devices directly from the dashboard of zwavejs2mqtt.
Any idea which action I need to take ?
2021-11-23T20:09:38.880Z CNTRLR [Node 010] [~] [Binary Switch] currentValue: true => false [Endpoint 0]
2021-11-23 21:09:38.880 INFO ZWAVE: Node 10: value updated: 37-0-currentValue true => false
2021-11-23T20:09:39.885Z SERIAL » 0x010900130a022502250ae5 (11 bytes)
2021-11-23T20:09:39.886Z DRIVER » [Node 010] [REQ] [SendData]
│ transmit options: 0x25
│ callback id: 10
└─[BinarySwitchCCGet]
2021-11-23T20:09:39.887Z SERIAL « [ACK] (0x06)
2021-11-23T20:09:39.894Z SERIAL « 0x0104011301e8 (6 bytes)
2021-11-23T20:09:39.894Z SERIAL » [ACK] (0x06)
2021-11-23T20:09:39.895Z DRIVER « [RES] [SendData]
was sent: true
2021-11-23T20:09:39.936Z SERIAL « 0x010700130a000004e5 (9 bytes)
2021-11-23T20:09:39.937Z SERIAL » [ACK] (0x06)
2021-11-23T20:09:39.938Z DRIVER « [REQ] [SendData]
callback id: 10
transmit status: OK
2021-11-23T20:09:49.943Z CNTRLR [Node 010] Timed out while waiting for a response from the node (ZW0201)

@titidnh Are you using zwavejs integration?

Yes i'm using the docker instance of zwavejs integration.
With the silly level
2021-11-24T12:20:42.054Z DRIVER » [Node 010] [REQ] [SendData]
│ transmit options: 0x05
│ callback id:      7
└─[SecurityCCNonceReport]
nonce: 0xa3cbea507cb25bab
2021-11-24T12:20:42.062Z SERIAL « [ACK]                                                                   (0x06)
2021-11-24T12:20:42.072Z SERIAL « 0x0104011301e8                                                       (6 bytes)
2021-11-24T12:20:42.074Z SERIAL » [ACK]                                                                   (0x06)
2021-11-24T12:20:42.077Z DRIVER « [RES] [SendData]
was sent: true
2021-11-24T12:20:42.084Z SERIAL « 0x0107001307000003ef                                                 (9 bytes)
2021-11-24T12:20:42.087Z SERIAL » [ACK]                                                                   (0x06)
2021-11-24T12:20:42.090Z DRIVER « [REQ] [SendData]
callback id:     7
transmit status: OK
2021-11-24T12:20:42.106Z SERIAL « 0x01240004000a1e9881ccb34ee495ec9b3397492584511bf690ba4a6ba39032191 (38 bytes)
7344bb60bd3
2021-11-24T12:20:42.110Z DRIVER   Dropping message with invalid payload
2021-11-24T12:20:42.111Z DRIVER « [Node 010] [REQ] [ApplicationCommand]
└─[SecurityCCCommandEncapsulation] [INVALID]
error: Invalid auth code, won't accept security encapsulated command.
2021-11-24T12:20:42.113Z SERIAL » [ACK]                                                                   (0x06)

I'm also using the Aotec GEN5 Zwave key

@titidnh Please submit a full silly level zwavejs log file when you try to change the value from the ui


Remove Integration Test Reports from the pipeline

When all collectors are in place we should not need to retrieve integration test logs.
This ticket depends on:

#2697
#2698
#2699
#2700

Please keep in mind that the above mentioned tickets need to be finished before handling this ticket.
DoD

[ ] remove logs extraction from the pipeline here

@RealAnna I am interested in this.

This ticket has a few open dependencies, that first need to be done for this ticket to be ready.

This ticket has a few open dependencies, that first need to be done for this ticket to be ready.

I am aware of that, I just wanted to indicate my interest


Need Information about how to get more information in metric labels and custom metric collection

purefb_alerts_open metric has below labels:

component_name
component_type
severity

Is there a way to capture more detailed Alert information - probably short summary and description as part of the labels?
If I want to collect more information about the metrics which are currently not part of the exporter, is there a way for me to build some object template for the data collection that exporter will export?

The way alerts metrics (and all the metrics reported by the exporter in general) are built is through direct invoking Pure FB REST API and in this case the only information that is made available by the API is the type of the alert and the counter of the related events. There is anyhow possibility to go deeper when a sllightly different approach is used, that is when also the FB logs are collected and sent for instance to ElasticSearch together with the exporter metrics. In that case it is possible to cross correlate the events and analyze them. This is a nice and not negligible side effect enabled by the exporter.

@genegr - How do I query the FB logs?
From the Alerts point of view, adding a TYPE description to the metric label makes more sense, because that I can send as a part of the alert. Of course, logs and ES will be more useful for further details. Is it possible to add TYPE description to the purefb_alerts_open metric?

Well, the problem with metrics like these that are related to logged messages is that there is not a canonical way to group/classify the messages so that it could be possible to add something like the TYPE description you are proposing. All what we have is the object we get as the response from the API call, which has among the others a summary description, but that is neither short enough nor "standardized" to be assumed as a categorization for the object itself. I frankly do not have a solution to that at the moment.


feat(sentry): added a server module

:tada: This PR is included in version 1.0.0-alpha.2 :tada:
The release is available on:

npm package (@alpha dist-tag)
npm package (@alpha dist-tag)
GitHub release

Your semantic-release bot :package::rocket:

:tada: This PR is included in version 1.0.0 :tada:
The release is available on:

npm package (@latest dist-tag)
npm package (@latest dist-tag)
GitHub release

Your semantic-release bot :package::rocket:


Optimize Vec<i8>, Vec<bool> and else

in the same manner as https://github.com/paritytech/parity-codec/pull/83

One way to do so is renaming IsU8 to IsByte and implement true for every type that has one byte representation.
Also we can extend wrapper type, for instance tuple of one variant could write IsU8 = T::IsU8.
And also single field struct could make use of it, but this might be debatable.

Well bool representation is unlikely to change but I'm not sure it is legal to rely on it though.
What about the others as well ? I don't know about this kind of stuff, it seems to me they won't change but at the same time they are allowed to do so.

We now have type_info which includes i8, maybe there is some other implementation to optimise but this issue is fixed


Erik the Outgolfer: Watch gkguide.in

Erik the Outgolfer requests the watch of the watch_keyword gkguide\.in. See the MS search here and the Stack Exchange search here.

gkguide\.in has been seen in 1 true positive, 0 false positives, and 0 NAAs.

!!/approve


[Low] Tooltips are enabled by default in Vuetify page objects

Steps to reproduce:

Go to https://vuetifyjs.com/en/components/checkboxes/
Generate PO using Vuetify library

Expected result: Tooltip is disabled in filter by default
Actual result: Tooltip is enabled in filter by default
https://user-images.githubusercontent.com/106632366/230353100-116febc1-0438-4114-8d21-b103e69de149.mp4

please, see the latest plugin version 3.10.438

JDN v 3.10.438 Back-end v 0.2.31
Chrome Version 112.0.5615.50 (Official Build) (64-bit)
The bug is fixed.
https://user-images.githubusercontent.com/106632366/230592399-6a380d62-ae01-40a2-a109-5c62601bf8d2.mp4


KAFKA-12288: remove task-level filesystem locks

The filesystem locks don't protect access between StreamThreads, only across different instances of the same Streams application. Running multiple processes in the same physical state directory is not supported, and as of PR #9978 it's explicitly guarded against), so there's no reason to continue locking the task directories with anything heavier than an in-memory map.
Ripping out out the task-level filesystem locks not only cleans up the code, but removes an occasional source of trouble due to IOExceptions. We now use only an umbrella lock of the state directory itself which is held for the lifetime of the application

Call for review any of @cadonna @wcarlson5 @lct45 @guozhangwang @rodesai  @swist

@wcarlson5 that's a good question, and I totally agree we should be more careful about that. In theory we should always clean up all state including unlock task directories during a thread's shutdown, but it's possible something slips through and a task directory gets orphaned. I filed a ticket to address this a while back: see  KAFKA-10563
That said, I think it's somewhat of an orthogonal concern and would prefer to do that in a separate PR to keep this one light. I don't think the changes here make that any better or worse -- if a dying thread orphaned some tasks, we weren't cleaning up the filesystem locks either.

@wcarlson5 I ended up putting a minor guard against orphaned task directories into this PR. It's not perfect but basically we just let the cleaner thread verify that any locked task directories belong to one of the currently running StreamThreads. Let me know what you think

One unrelated test failure: kafka.network.ConnectionQuotasTest.testListenerConnectionRateLimitWhenActualRateAboveLimit
Merging to trunk, I'll eventually cherrypick this back to 2.6, 2.7, and 2.8 once these branches are out of the release process

Thanks @guozhangwang !

If users mistakenly use the same stat dir, is that undefined behavior or do we fail fast in a deterministic way? If it's the former do we have test case covering it?

Yes, we added the guard against that in PR #9978

Do we have test case covering "thread is gone but the map still have it" case for the cleanup thread?

Not yet, but that's what I was referring to when I said I wanted to add another test to this PR in my earlier comment above yours

I suggest we also add something in docs emphasizing that we were trying to guard against multiple instances with the same state dir on same node, and we do not do that now.

As noted above, we do still guard against this case but with a top-level state directory lock instead of individual task dir locks. This situation is documented in this PR


[MPWG Page] add under Knowledge tab: MPWG Members Onboarding Documentation

Members Onboarding Into MPWG Documentation

Sent reply by email

Sent reply by email


Clarify which files are being watched by skpm build --watch

It's not clear in the docs whether an edit on any of the JSON files in a project should trigger a rebuild when using skpm build --watch, and I'm not sure if that's a bug or a feature : )

Right now it's only watching the files compiled with webpack, i.e. not the manifest.json or the package.json.
You are saying that it should watch them as well?

I don't know… 😄
I guess I was hoping that skpm would rebuild the plugin whenever I edit anything on the project (think: images / html for panels / JSON / assets…)

As long as the assets are in plugin.sketchplugin/Contents/Resources, there is no need to rebuild right?

Hi,
I'm using the Contents/Resources to put here an external command so would be nice to watch the whole folder 😸

But what would it do? I mean, even if it catches an change in the Contents/Resources folder, there is no way to know what it should do with it

The external command is called inside the cocoascript file within a NSTask, so it will know what to do with it 🤗

but there is "nothing" to do. Rebuilding the plugin just mean running webpack on the src. It doesn't do anything else. If you change the file in Contents/Resources, the plugin will automatically use it, no need to rebuild it

agree, but you still have to run the plugin manually, while skpm build --watch --run would do it for you...

ohhh, got it.
@bomberstudios was it the same request? Rerun the plugin of there is a change in the assets?

Not sure. Here's my use case:

I create a new plugin
I start writing code, plugin builds as expected and is updated in Sketch
Now I want to tweak the description, or the name, or the version… so I edit the manifest.json or package.json, and the plugin is not built, and not updated in Sketch

Also, what if I update an asset in Resources (i.e: update an icon)? That should definitely trigger a rebuild and update the plugin in Sketch?
FTR, I don't want to run anything, just to be sure that whenever anything plugin-related is updated on my project, the plugin gets rebuilt.

while I understand for the manifest.json and the package.json (I also get tricked sometimes as well), there is no need to rebuild anything when updating an asset.

then a "simple" watch Resources and run should be enough in this case, right?

Ah, you're right, I totally forgot that there's an actual .sketchplugin folder in the project root 🤦♂

(Apologies for the noise, I have another project where I use something similar to skpm but not exactly the same, and I was getting my memories all mixed up)

@rborn I guess so. Can you create another issue as this is not really related to this (watching the package.json and manifest.json)?

There's a good reason not to rely on keeping source resources in the plugin itself. If I'm editing an image, for example, in an image editor, I can't save it directly in plugin because the Save dialog sees it as a bundle and won't let me navigate to the Resources folder.
This is quite easy to fix using the copy-webpack-plugin, I'll make a PR that allows us to specify files/folders that will get copied into Plugin/Contents/Resources.

Just require your image from your code, it will be copied automatically

On 31 Oct 2017, at 20:42, Aparajita Fishman<EMAIL_ADDRESS>wrote:
There's a good reason not to rely on keeping source resources in the plugin itself. If I'm editing an image, for example, in an image editor, I can't save it directly in plugin because the Save dialog sees it as a bundle and won't let me navigate to the Resources folder.
This is quite easy to fix using the copy-webpack-plugin, I'll make a PR that allows us to specify files/folders that will get copied into Plugin/Contents/Resources.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Copied into _webpack_resources with a hashed name? No thanks. To me this is one of the most crazy aspects of webpack. I shouldn't have to add a line of code in my Javascript for each static asset. The copy-webpack-plugin deals with static resources in a much better way, and also watches them for changes.
There are other scenarios where it just doesn't make sense to require an image in your code. For example, icons for Runner. And static resources that are part of a nib being loaded. In those cases it makes much more sense to just copy the static resources, because there is no processing going on.
It seems you don't want any changes made to skpm because you don't want any added maintenance. That's fine, I'll publish webpack plugins that won't require changes to skpm.

I mean you can already add any plugin to the webpack config without any need to change npm so I’m not sure what you would actually change.
The one change I would consider is checking if the files from the “resources” field in the package.json are statics and if so, copy them.

On 31 Oct 2017, at 21:43, Aparajita Fishman<EMAIL_ADDRESS>wrote:
Copied into _webpack_resources with a hashed name? No thanks. To me this is one of the most crazy aspects of webpack. I shouldn't have to add a line of code in my Javascript for each static asset. The copy-webpack-plugin deals with static resources in a much better way, and also watches them for changes.
There are other scenarios where it just doesn't make sense to require an image in your code. For example, icons for Runner. And static resources that are part of a nib being loaded. In those cases it makes much more sense to just copy the static resources, because there is no processing going on.
It seems you don't want any changes made to skpm because you don't want any added maintenance. That's fine, I'll publish webpack plugins that won't require changes to skpm.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

That's what I was going to do, add a "resources" field to "skpm" in package.json. I was going to allow it to be an array for flexibility. Anything in those folders (or matching those globs, even better), would be copied to the plugin's Resources folder.

And if a resources directory is specified, the hierarchy of that directory should be maintained during the copy. If you're going to use copy-webpack-plugin, you might as well allow the contents of the resources array to be either strings or objects. If objects, they are patterns that can be passed directly to the plugin.

Just to be clear: you can already specify an array of globs in the “resources” field. Right now it will try to compile the files, super useful for webviews for example.
It would just be about check the extension of the file and if it’s not already handled by webpack, copy it.

On 31 Oct 2017, at 22:29, Aparajita Fishman<EMAIL_ADDRESS>wrote:
And if a resources directory is specified, the hierarchy of that directory should be maintained during the copy. If you're going to use copy-webpack-plugin, you might as well allow the contents of the resources array to be either strings or objects. If objects, they are patterns that can be passed directly to the plugin.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

It sure would be nice if these things were documented...

Right now they're being copied and compiled. That doesn't seem quite right.

I don't know… 😄
I guess I was hoping that skpm would rebuild the plugin whenever I edit anything on the project (think: images / html for panels / JSON / assets…)

I have the same need as you


Evaluate if Main-Class in Manifest.txt can be used to determine Java entrypoint

See https://docs.oracle.com/javase/tutorial/deployment/jar/appman.html
It seems that there exist an additional idiomatic way to define the entrypoint of a Java app.

CC @ludoch @glaforge

CC @ludoch @glaforge

Is it not done in:
https://github.com/GoogleCloudPlatform/buildpacks/blob/cb5b92639ded8fd161629cb3a1dc3d0fb00cc066/pkg/java/java.go#L45
// ExecutableJar looks for the jar with a Main-Class manifest. If there is not exactly 1 of these jars, throw an error.

Is it not done in:
https://github.com/GoogleCloudPlatform/buildpacks/blob/cb5b92639ded8fd161629cb3a1dc3d0fb00cc066/pkg/java/java.go#L45
// ExecutableJar looks for the jar with a Main-Class manifest. If there is not exactly 1 of these jars, throw an error.

I assume you mean "now" instead of "not"?
If it's supported, please document it here

I assume you mean "now" instead of "not"?
If it's supported, please document it here

See https://github.com/GoogleCloudPlatform/buildpacks/blob/58e6045476f951cdada4423b86369eb6214b6002/README.md#language-specific-behavior

See https://github.com/GoogleCloudPlatform/buildpacks/blob/58e6045476f951cdada4423b86369eb6214b6002/README.md#language-specific-behavior

Ah right it's already there.

Ah right it's already there.


MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates

Description
By default DBeaver is configured to use mysql-connector-java as JDBC library to connect to MySQL.
This library has moved and can't be updated in DBeaver anymore.
Old: https://mvnrepository.com/artifact/mysql/mysql-connector-java
New: https://mvnrepository.com/artifact/com.mysql/mysql-connector-j
This is noted in Maven Public:

Note: This artifact was moved to:
com.mysql » mysql-connector-j
MySQL Connector/J artifacts moved to reverse-DNS compliant Maven 2+ coordinates.

DBeaver Version
Community Edition 23.2.4
Operating System
Ubuntu 22.04.3 LTS
Database and driver
No response
Steps to reproduce
Go to Driver Manager and try to update MySQL library to latest version -> all versions as of 8.0.31 will fail to download.
Additional context
No response

Oh, seems like this is already fixed with https://github.com/dbeaver/dbeaver/commit/7601654aedbb10343802e4cf98920b169a310902

And, fix is shipped with v23.2.5  ✔


isogram: Revise canonical test data

This removes the two unicode test cases as discussed in #428. One test case was an isogram with German umlauts, the other one was a French word with a duplicated character with accent (also non-ASCII). I don't think we loose anything here without those test cases that isn't covered by the remaining ones.
I also added descriptions for the test cases and a test case with an empty string. If you would prefer those non unicode changes in a separate PR, just ask.

Awesome, looks good. thanks @behrtam

Including a test case with spaces might also be good.
"the quick brown fox jumps over the lazy dog"
Might be interesting since it is a panagram, but not an isogram.
"no duplicates"
Is an isogram and is autological

(sorry to hijack your PR with potentially unrelated changes.)

The last test case "Emily Jung Schwartzkopf" has two white spaces, so you thing we should add a negative test case with white spaces?

@behrtam I think the "Emily Jung Schwartzkopf" case covers it.

Thanks @behrtam :heart:


[Crash Consistent RestorePoints] Making consistencyMode input parameter for RestorePoint

MSFT employees can try out our new experience at OpenAPI Hub  - one location for using our validation tools and finding your workflow.

Changelog
Add a changelog entry for this PR by answering the following questions:

What's the purpose of the update?

[ ] new service onboarding
[ ] new API version
[ ] update existing version for new feature
[ ] update existing version to fix swagger quality issue in s360
[ ] Other, please clarify

When are you targeting to deploy the new service/feature to public regions? Please provide the date or, if the date is not yet available, the month.
When do you expect to publish the swagger? Please provide date or, the the date is not yet available, the month.
If updating an existing version, please select the specific language SDKs and CLIs that must be refreshed after the swagger is published.

[ ] SDK of .NET (need service team to ensure code readiness)
[ ] SDK of Python
[ ] SDK of Java
[ ] SDK of Js
[ ] SDK of Go
[ ] PowerShell
[ ] CLI
[ ] Terraform
[ ] No refresh required for updates in this PR

Contribution checklist:

[ ] I commit to follow the Breaking Change Policy of "no breaking changes"
[ ] I have reviewed the documentation for the workflow.
[ ] Validation tools were run on swagger spec(s) and errors have all been fixed in this PR. How to fix?

If any further question about AME onboarding or validation tools, please view the FAQ.
ARM API Review Checklist

Applicability: :warning:
If your changes encompass only the following scenarios, you should SKIP this section, as these scenarios do not require ARM review.

Change to data plane APIs
Adding new properties
All removals

Otherwise your PR may be subject to ARM review requirements. Complete the following:

[ ] Check this box if any of the following apply to the PR so that label "WaitForARMFeedback" will be added automatically to begin ARM API Review. Failure to comply may result in delays to the manifest.

Adding a new service
Adding new API(s)
Adding a new API version
-[ ] To review changes efficiently, ensure you are using OpenAPIHub to initialize the PR for adding a new version. More details, refer to the wiki.

[ ] Ensure you've reviewed following guidelines including ARM resource provider contract and REST guidelines. Estimated time (4 hours). This is required before you can request review from ARM API Review board.

[ ] If you are blocked on ARM review and want to get the PR merged with urgency, please get the ARM oncall for reviews (RP Manifest Approvers team under Azure Resource Manager service) from IcM and reach out to them.

Breaking Change Review Checklist
If any of the following scenarios apply to the PR, request approval from the Breaking Change Review Board as defined in the Breaking Change Policy.

[ ] Removing API(s) in a stable version
[ ] Removing properties in a stable version
[ ] Removing API version(s) in a stable version
[ ] Updating API in a stable or public preview version with Breaking Change Validation errors
[ ] Updating API(s) in public preview over 1 year (refer to Retirement of Previews)

Action: to initiate an evaluation of the breaking change, create a new intake using the template for breaking changes. Addition details on the process and office hours are on the Breaking change Wiki.
Please follow the link to find more details on PR review process.

The Go track 1 generation fails because the base branch is out of date. I should have fixed that in main. Therefore we could ignore that in this PR. Please let me know when this is ready to merge, or merge it by yourself

Hi @prchin do we have any update on this PR?

@ArcturusZhang , i added 'donotmerge'  and will merge this PR when ready.
But why are the CI failures failing here?

/azp run

/azp run


can not link when cargo build

Undefined symbols for architecture x86_64:
"_TLSv1_1_method", referenced from:
ssl::SslMethod::to_raw::h686151258a67edaffOd in libopenssl-9e4539c913eed78d.rlib(openssl-9e4539c913eed78d.0.o)
ssl::SslMethod::from_raw::hc309ec26131750e5FOd in libopenssl-9e4539c913eed78d.rlib(openssl-9e4539c913eed78d.0.o)
"_TLSv1_2_method", referenced from:
ssl::SslMethod::to_raw::h686151258a67edaffOd in libopenssl-9e4539c913eed78d.rlib(openssl-9e4539c913eed78d.0.o)
ssl::SslMethod::from_raw::hc309ec26131750e5FOd in libopenssl-9e4539c913eed78d.rlib(openssl-9e4539c913eed78d.0.o)
ld: symbol(s) not found for architecture x86_64
[dependencies]
amqp = "0.0.13"
env_logger = "0.3.2"
rustc version:  rustc 1.4.0 (8ab8581f6 2015-10-27)
build the example consume code

Try running cargo build --no-default-features to disable openssl.
If you're running this on MacOS X, the issue is that they ship old openssl version, which does not support TLS1.1. You need to use newer openssl >=0.9.8zg or 1.0.2d or 1.0.1p or 1.0.0s.
On Mac OS X you can install openssl with brew and force link it: brew link --force openssl.

thanks reply!
i try to  renew sample project,  execute:
brew link --force openssl
Linking /usr/local/Cellar/openssl/1.0.2d_1... 1548 symlinks created
and i see the openssl 0.6.7 when cargo build:
cargo build --no-default-features
Compiling lazy_static v0.1.15
Compiling matches v0.1.2
Compiling libc v0.2.2
Compiling rustc-serialize v0.3.16
Compiling byteorder v0.3.13
Compiling bit-vec v0.4.2
Compiling libc v0.1.12
Compiling bitflags v0.3.3
Compiling pkg-config v0.3.6
Compiling num v0.1.27
Compiling regex-syntax v0.2.2
Compiling gcc v0.3.19
Compiling log v0.3.3
Compiling memchr v0.1.7
Compiling aho-corasick v0.3.4
Compiling openssl-sys v0.6.7                //<-----------------
Compiling enum_primitive v0.1.0
Compiling regex v0.1.41
Compiling openssl v0.6.7
Compiling env_logger v0.3.2
Compiling url v0.2.37
Compiling amqp v0.0.13
i show my openssl version is:
openssl version
OpenSSL 0.9.8zg 14 July 2015
I noticed this setting at rust-amqp's Cargo.toml

I got it.
the reason is
the older verion default path /usr/lib/libssl.0.9.7.dylib,  and cargo build's link include this system path, so it should use that old verion default.
so, I copy that link cmd,  exclude the /usr/lib/  and join my /usr/local/lib,  link success.
PS: is there any argument to make the cargo build's link cmd not include the default path?

I am not sure, I had the same issue few times, but then if you do a clean rust/cargo install, it picks  a correct location.


Add SkiaSharp-based default imager for torchvision.io.

@kaiidams -- time to take a quick look?

    public enum ImageFormat

Should compare this list with what SkiaSharp support?
https://learn.microsoft.com/en-us/dotnet/api/skiasharp.skencodedimageformat?view=skiasharp-2.88

Refers to: src/TorchSharp/TorchVision/IO/ImageFormat.cs:8 in d72ce6c. [](commit_id = d72ce6c37d2639bf2e76d724c649e6dabc30ddb0, deletion_comment = False)

Thanks for the feedback, everyone! I'm going to close this PR now and come back with one that separates TorchVision and TorchAudio into their own packages, and then we can take up the discussion about image backend choices again.

To break out TV into its own package, there's a problem with the Tensor.Tensor(IntPtr handle) ctor. We either need to start using friend assemblies (yuck!), make the constructor public (there's all kinds of issues with that), or introduce a derived class 'ImageTensor' in TV and then make the Tensor ctor protected. It al feels very hacky.

there's a problem with the Tensor.Tensor(IntPtr handle) ctor

What are the problems with such a constructor? Is it possible to expose some static method like UnsafeCreateTensor(IntPtr)? which can tell it is unsafe and at the same time allow the functionality?

there's a problem with the Tensor.Tensor(IntPtr handle) ctor

What are the problems with such a constructor?

The risk of passing something in that wasn't created the right way in native code.

Is it possible to expose some static method like UnsafeCreateTensor(IntPtr)? which can tell it is unsafe and at the same time allow the functionality?

That's an excellent idea -- make it available but highlight the risk.

FYI -- @tarekgh, @lostmsu, @kaiidams, @GeorgeS2019
Here's some context on the decision to go with SkiaSharp instead of ImageSharp as the default, "out of the box" image reader:
https://dotnetfoundation.org/blog/2022/10/20/imagesharpupdate
We did not want to create a transitive dependency on ImageSharp with TorchSharp. Therefore, the options were to have no have no default image reader, to go with one that is offered under an OSI-compliant license like SkiaSharp, or to fork a version of ImageSharp from before the license change. We felt that having no reader would provide a poor experience, and that forking ImageSharp is not something we want to do as good citizens of the .NET OSS community at large. Therefore, we decided that SkiaSharp was the best option given the circumstances.
An unsupported ImageSharp-based image reader is available in one of the examples.