Fail to play a short sound

:beetle: Description
I want it to play a sfx, which shorter than a second, whenever I click a button.
I wonder if the sound clip length have a lower limit.
:beetle: What have you tried?
When I try to use the play() with a .mp3 length longer than 1 sec, it works fine, but when I try to use a shorter .mp3 length shorter than 1 sec, the play() success callback return false.
Is your issue with...

[ ] iOS
[ v ] Android
[ ] Windows

Are you using...

[ v ] React Native CLI (e.g. react-native run-android)
[ ] Expo
[ ] Other: (please specify)

Which versions are you using?

React Native Sound: "^0.11.0"
React Native: "0.59.5"
iOS:
Android: 6.0.1
Windows:

Does the problem occur on...

[ ] Simulator
[ v ] Device

If your problem is happening on a device, which device?

Device:

Hi! Could you post your code, please?

const thisPlay = new Sound("http://image.mypays.cn/data/lsy/sound/aa_bb.mp3",null, e => {
if (e) {
console.log(e)
return
};
thisPlay.play(() => thisPlay.release());
});

@QShengW Could you post a new issue and fill out the full template, please?

@earlquadra8 I had this issue as well (loaded from the raw directory). Exact same error. After a very long investigation on this I found the issue is with Android not with this package. I used a mp3 validator and found out that if an mp3 doesn't have at least 5 mpeg frames it is invalid. iOS and macOS don't care, but Android does and won't load it. I had to switch my 1 second mp3's that had 1 - 2 mpeg frames out with wav versions and it works great.

same issue here.
let's say you have a multiple flip effect with a delay of 400ms between the flips.
flip = new Sound('flip.wav', Sound.MAIN_BUNDLE);
flip.play();
setTimeout(() => { flip.play(); }, 400);
the sound will work just for the first play.  but not for the one inside the timeout.
but if the timeout is > 1000ms, is works fine.

Here's how i achieve it using a pop sound effect
onPress={() => {
   popSFX.stop();
   popSFX.play();
}}

Same here


Updated README for navigable table of contents

Pull Request Format
Update README for navigable table of contents
Issue #700 : Update README for navigable table of contents  solved
Type of PR

Add X in the box to specify the improvement type.
[ ] Bug fix
[ ] Feature enhancement
[x] Documentation update
[ ] Other (specify): ___________

Description
This pull request updates README for navigable table of contents
Screenshots / Videos (if applicable)
Before:

it was difficult to navigate to various sections of the README

After:

After the addition of README navigation became easier

Checklist

Add X in the box to specify.
[X] I have performed a self-review of my code.
[x] I have tested the changes thoroughly before submitting this pull request.
[x] I have provided relevant issue numbers, screenshots, and videos after making the changes.
[ ] I have commented my code, particularly in hard-to-understand areas.

Additional Context
[Provide any additional context about the changes, such as specific challenges you faced or decisions you made. This can help reviewers understand the rationale behind your changes.]
Thank you for reviewing my pull request!

please review my changes

please review my changes

i made the changes please review my changes

please review my changes


Remove delays in HubConnectionTests

We can remove these delays now that https://github.com/aspnet/SignalR/pull/92 has been merged.
@anurse @moozzyk @BrennanConroy

Hi @mikaelm12, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!
The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.
TTYL, DNFBOT;

:clap:


Adding a utility method for configuring the puppet.conf file

There are many use cases for this, testing non-standard puppet
installations, testing switching environments etc.

This issue is duplicated in #474. As that issue has additional comments, this issue (#428) should be closed as a duplicate.

Duplicate.


Convert kubelet cmdline flags to config file

All cmdline flags are deprecated and kubelet should be configured with a YAML file now. We shoulud ake this the default for cluster >= 1.11
/kind tech-debt
/milestone release-0.5

/assign


List query filter improvements

Deprecation of existing list
Some of my applications rely heavily on current implementation. I think removal should be done only after similar mechanism will be developed. Creating procedures for each entity is rather time consuming.
New filter syntax suggestion:
One of the possible solutions is to use Mongo like syntax http://rest-layer.io/#filtering
userNodes(filters:UserFilters,order:UserOrdering,pagination:Pagination)

UserFilters
{
  login: StringFilters
  email: StringFilters
  birthdate: DateFilters
}

StringFilters
{
 eq: String
 like: String
 regex: String
}

DateFilters
{
 gt: Date
 ge: Date
 between: [Date,Date]
}

Each Filter can also be a union type:
StringFilters = String | StringFiltersExtended

StringFiltersExtended
{
 eq: String
 like: String
 regex: String
}

By default equality filters is performed. That allow keep compatibility with previous syntax(in case if all fields will be listed in query itself)
In this way we will be able to support specific operators for different types. Otherwise this can be parametrized type with (eq,gt,ge,le,etc..) operators

See https://github.com/calebmer/postgraphql/pull/46

Ok, I kinda like this. Are we assuming multiple filters are all joined by AND? Do we want to support OR filters?
Also, I’d really like to remove the argument-per column style (as it adds a lot of noise to the field argument list) so I really like your filter name.
The implementation I was originally playing around with would look like the following, tell me what you think:
postNodes(filters: [PostFilter], …)

type PostFilter {
  operator: Operator,
  field: String,
  value: Any
}

enum Operator {
  EQUAL,
  LIKE,
  REGEX,
  …
}

And we could also make a special type for every field to restrict operators depending on type…
This may be way over complicating things.

My opinion : it's better to model filters in mongo-like query syntax. It's supported in many other databases(pouchdb,lokijs,etc) and is slowly became a standard way to describe filters.
postNodes(filters: FiltersClause)

type FiltersClause {
  id: IDFilter
  name: StringFilter
  created: DateFilter
  $or: [FiltersClause]
}

type IDFilter = ID | {
 $eq: ID,
 $in: [ID]
}

type DateFilter = Date | {
 $eq: Date,
 $between: [Date,Date],
 $in: [Date],
 $gt, $le ...
}

Map have AND semantics
List have OR semantics
Top level - AND clause

About strong-typed filter clauses vs generic filter clauses - I prefer strong typing. It gives us:

autocompletion in graphqli
validation of operators during schema parsing, not during database query execution(gives much readable errors)
user will not be confused what operators is allowed for certain datatypes

Ok, I think this is a good proposal. I’m just not totally sold on the $ semantics (yeah I know it’s what everyone else uses 😊). I’d also prefer to expand some names instead of using their acronyms, so greaterThan instead of gt, oneOf instead of in, etc. Also, instead of using $or, how do you feel about:
postNodes(filter: FiltersClause | [FiltersClause])

…where like you said, map has AND semantics and a list has OR semantics. We may even consider:
postNodes(filter: FiltersClause | [FiltersClause] | [[FiltersClause]])

Where [[a, b], [c, d]] represents (a and b) or (c and d). I think that might be overkill though…

Would be really great to have custom filtering.
Any idea on how to simulate in clause behavior with views/functions?

I’m still waiting for a good proposal on advanced filters since I recognized input unions are not a thing and might not ever be 😞. Ultimately, I’m just not sure if GraphQL input is flexible enough to allow for conditions of the complex nature we’d like to see.
However, this is totally possible with procedures and definitely the recommended way for now. Try something like the following:
create function my_filter_function(numbers int[]) returns setof my_table as $$
  select *
  from my_table
  where
    my_column = any (numbers)
$$ language sql stable;

Note here that we used = any vs in here. See the Node.js pg docs on parameterized queries for a basic explanation why (although it is in a different yet tangentially similar context). Also see the Postgres docs on array searching.

I'am looking forward about this mongo like filtering feature.For example MongoDB/Mongoose provides JSON filter object with all possible kind of operators.

I am not well versed in Postgres procedures, so please bear with me as  I am probably not understanding.   In my case i would likely want to filter by combinations of fields (and in fact potentially combinations of all fields).   However in  a lot of cases I will only be passing a subset of those fields.  for example I might have in my app:
minimum salary: 20000
maximum salary: 40000
job type:   administrator
job title: adm
I can see how I would build a procedure to do all of these, but how do I create this procedure to allow me to only pass values for some of those fields and not query them.  i.,e.  I might set only job type, so rest of values are null, and would want to query recrods where job type='adm' only.
I want a procedure where I could specify all input fields and values and then build the query based on those which have a value not null.
It is clearly a lack of understanding on my part but if I can nail this then the procedures will work for me.
Please feel free to tell me I am being stupid!!

Here's some pseudocode that might inspire you:
create function search(row my_table) returns setof my_table as $$
const args = [];
const values = [];
for (var k in row) {
  if (row[k] != null) {
    args.push(k);
    values.push(row[k]);
  }
}
if (args.length > 0) {
  var query = 'select * from my_table where ' + args.map(arg => plv8.quote_ident(arg) + ' = ?').join(', ');
  return plv8.execute(query, values)
} else {
  return [];
}
$$ stable language plv8;

PSEUDO CODE, UNTESTED, NOT GUARANTEED IN ANY WAY, USE AT YOUR OWN RISK, PROBABLY DOES NOT ANSWER YOUR QUESTION DIRECTLY.

That's great thanks Benjie.  I get the drift ... very helpful.
Sent from my iPhone
On 2 Jul 2017, at 13:02, Benjie Gillam<EMAIL_ADDRESS>wrote:
Here's some pseudocode that might inspire you:
create function search(row my_table) returns setof my_table as $$
const args = [];
const values = [];
for (var k in row) {
if (row[k] != null) {
args.push(k);
values.push(row[k]);
}
}
if (args.length > 0) {
var query = 'select * from my_table where ' + args.map(arg =>
plv8.quote_ident(arg) + ' = ?').join(', ');
return plv8.execute(query, values)
} else {
return [];
}
$$ stable language plv8;
PSEUDO CODE, UNTESTED, NOT GUARANTEED IN ANY WAY, USE AT YOUR OWN RISK,
PROBABLY DOES NOT ANSWER YOUR QUESTION DIRECTLY.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/postgraphql/postgraphql/issues/47#issuecomment-312487778,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AG49LwDrKemnPa6nYYYdm97-g9cvipcqks5sJ4bHgaJpZM4IcDNx
.

I'd love to see a plugin for v4 that adds additional (or replacement) condition filters - if one gets enough approval we could look at merging it into core 👍

Can't wait to get generated conditional filters

@pencilcheck How do you see it working?

Thanks for asking me this. As I have a lot of ideas on how to make this work and be more flexible and extensible.
My idea is based on how my experience with writing stored procedures for PostgreSQL and noticing some patterns.
Usually most of the stored procedures follows the rules of

Write a function that takes input
Convert inputs into boolean or strings
Create a query
Return that query

In step 3, it uses the input for a lot of stuff, could be for deciding which query to return, or which condition to be satisfied, or which filtering (WHERE) should be executed, and which ordering (ORDER BY) should be executed.
Ideally we can express all 100% PostgreSQL syntax so we can filter without changing the stored procedure, but that is too ambitious and might not make sense for some concerns such as security.
But we can setup a syntax which I think could be a useful starting point
query FetchEvents($whereArgs: WhereArgs) {
  fetchEvents(where: $whereArgs) {}
}

WhereArgs = Object[]

Let's say you want to do the following filtering
SELECT ... WHERE id = '123' AND (CHAR_LENGTH(description) > 5 OR liked);

What could be translated into
Variables
{
  "whereArgs": [
    {
      "leftOperand": "id",
      "operation": "=",
      "rightOperand": "'123'",
      "parseClass": 0
    },
    {
      "leftOperand": "CHAR_LENGTH(description)",
      "operation": ">",
      "rightOperand": "5",
      "parseClass": 1
    },
    {
      "leftOperand": "liked",
      "parseClass": 1
    }
  ]
}

WhereArgs is a flat list.
Each object in the list has the following attributes

leftOperand
operation
rightOperand
parseClass

1, 2, 3 should be obvious, their values will be inserted as part of the expression directly

is very interesting too, this solution come since I wish I don't need to always have to nest to many ANDs and ORs if we make into the mongoDB style.

So by default if you leave out parseClass, it is assume it is always ANDing with the rest of the items.
But if you have some items with the parseClass set, and have the same value but different from other items, then they are interpreted as ORing each other.
The higher the parseClass value, the later it will be parsed in order.
I don't think this is the final form, as I haven't looked into more in depth use cases, nor is the naming is final as parseClass might be confusing to new users. However I think this is probably in my opinion that it might be easier because using the MongoDB style filtering (Scaphold user anyone?), I noticed that we also had a lot of issues with it. Namely:

Nesting hell
No parse ordering we can enforce (can only keep wrapping everything that enables more nesting hell)
Limited expressibility, as the mongoDB syntax limits the expressiveness by the operations that the syntax provides. Of course there are security and performance concerns here, the initial thing the implementation can go is to escape all known sensitive keywords such as semicolon, etc to prevent injections for instance.

I would like to leave this as a open form, and perhaps move to a new discussion thread but feel free to response and let me know your feedback.
Thanks.

From what I can tell, the current PostGraphQL condition argument performs equality checks on one or more fields:
query SingleField {
  allPosts(condition: {
    authorId: 2
  }) {
    ...
  }
}
# select ... from post where author_id = 2

query MultipleFields {
  allPosts(condition: {
    authorId: 2
    topic: SHOWCASE
  }) {
    ...
  }
}
# select ... from post where author_id = 2 and topic = 'showcase'

The next logical step would be to implement:

Additional comparison operators (!=, >, <, etc.)
Logical operators (and, or, and potentially not)

For comparison operators, the simplest solution is to append the operator name to the field name.  PostGraphQL uses a similar approach for the orderBy argument, appending _ASC and _DESC to every field name, e.g. orderBy: CREATED_AT_DESC.
So what should we name the operators?  Mongo-style names would look something like this:
Operator  Suffix  Example
--------  ------  -------
=                 authorId_eq
!=        _ne     authorId_ne
>         _gt     createdAt_gt
>=        _gte    createdAt_gte
<         _lt     createdAt_lt
<=        _lte    createdAt_lte
IN        _in     topic_in
NOT IN    _nin    topic_nin

A camelCase approach would look something like this:
Operator   Suffix                 Example
--------   ------                 -------
=                                 authorId
!=         _notEqualTo            authorId_notEqualTo
>          _greaterThan           createdAt_greaterThan
>=         _greaterThanOrEqualTo  createdAt_greaterThanOrEqualTo
<          _lessThan              createdAt_lessThan
<=         _lessThanOrEqualTo     createdAt_lessthanOrEqualTo
IN         _anyOf                 topic_anyOf
NOT IN     _notAnyOf              topic_notAnyOf

I think the camelCase approach is more in line with GraphQL naming conventions.  For comparison, consider the readability of topic_ne: SHOWCASE versus topic_notEqualTo: SHOWCASE.  It's obviously a trade-off between compactness and clarity, but GraphQL implementations tend to favor clarity.  In any case, it would be trivial to allow the preferred syntax to be defined using a config parameter in PostGraphQL, so let's not get hung up on this part.
Finally, here's a simple example of conditional operators in action:
query WithComparisonOperators {
  allPosts(condition: {
    authorId: 2
    topic_anyOf: [SHOWCASE, INSPIRATION]
    createdAt_greaterThan: "2017-07-01T00:00:00Z"
  }) {
    ...
  }
}
# select ... from post where author_id in (2, 5, 6) and topic != 'showcase';

If we omit the suffix on the equality operator (as shown in all of the examples to this point), then I think condition argument could be extended to support all of this without any breaking changes.  I don't have a strong opinion on appending _equalTo versus omitting it, but it seems unnecessary and it deviates from the current condition syntax.
With comparison operators in place, I think the logical operators would be pretty straightforward.  I couldn't come up with a complex query on allPosts, so instead I present you with this query for Star Wars characters that have unusual eyes and are either short-and-fat or tall-and-skinny:
query {
  allPeople (condition: {
    "and" : [{
      "eyeColor_notAnyOf" : ["blue","brown","green"],
      "or" : [{
          "height_lessThan" : 200,
          "mass_greaterThan" : 100
        },{
          "height_greaterThan" : 200,
          "mass_lessThan" : 50
        }]
    }]
  }) {
    ...
  }
}
# select * from person
# where
#   eye_color not in ('blue','brown','green')
#   and (
#     (height < 200 and mass > 100) or
#      (height > 200 and mass < 50)
#	);

This is the usual approach I've seen taken on JSON logic.  Would replacing all/or with allOf/anyOf improve readability?  Debatable.
It does become easy to descend into "nesting hell" as @pencilcheck put it, but the only alternatives I can think of are:

try to emulate SQL syntax with AND and OR keywords and grouping characters (feels dirty); OR
devise a new JSON schema for representing nested logic (essentially trading nesting hell for implementation and documentation hell)

Bottom line, I think nested and and or blocks are a reasonable starting point for PostGraphQL.
These are just my opinions and I would definitely appreciate feedback.  When the dust settles, I'll start working on a plugin for v4.

So I wrote a plugin for v4 the other day (as a quick hack) that does a small amount of what you started out suggesting:
module.exports = function PgConnectionArgCondition(
  builder,
  { pgInflection: inflection }
) {
  builder.hook(
    "GraphQLInputObjectType:fields",
    (
      fields,
      {
        extend,
        pgIntrospectionResultsByKind: introspectionResultsByKind,
        graphql: { GraphQLBoolean },
      },
      { scope: { isPgCondition, pgIntrospection: table }, fieldWithHooks }
    ) => {
      if (!isPgCondition || !table || table.kind !== "class") {
        return fields;
      }
      return extend(
        fields,
        introspectionResultsByKind.attribute
          .filter(attr => attr.classId === table.id)
          .filter(attr => !attr.isNotNull)
          .reduce((memo, attr) => {
            const fieldName = inflection.column(
              attr.name,
              table.name,
              table.namespace && table.namespace.name
            );
            // eslint-disable-next-line
            memo[`${fieldName}_null`] = fieldWithHooks(
              fieldName,
              {
                description: `Checks object’s \`${fieldName}\` field is null (true) or not null (false)`,
                type: GraphQLBoolean,
              },
              {
                isPgConnectionConditionInputFieldNull: true,
              }
            );
            return memo;
          }, {})
      );
    }
  );
  builder.hook(
    "GraphQLObjectType:fields:field:args",
    (
      args,
      {
        pgSql: sql,
        gql2pg,
        extend,
        getTypeByName,
        pgIntrospectionResultsByKind: introspectionResultsByKind,
      },
      {
        scope: { isPgConnectionField, pgIntrospection: table },
        addArgDataGenerator,
      }
    ) => {
      if (!isPgConnectionField || !table || table.kind !== "class") {
        return args;
      }

      addArgDataGenerator(({ condition }) => ({
        pgQuery: queryBuilder => {
          if (condition != null) {
            introspectionResultsByKind.attribute
              .filter(attr => attr.classId === table.id)
              .filter(attr => !attr.isNotNull)
              .forEach(attr => {
                const fieldName = inflection.column(
                  attr.name,
                  table.name,
                  table.namespace.name
                );
                const val = condition[`${fieldName}_null`];
                if (val != null) {
                  queryBuilder.where(
                    sql.fragment`${queryBuilder.getTableAlias()}.${sql.identifier(
                      attr.name
                    )} ${val
                      ? sql.fragment`IS NULL`
                      : sql.fragment`IS NOT NULL`}`
                  );
                }
              });
          }
        },
      }));

      return args;
    }
  );
};

This plugin extends the existing Condition type by adding foo_null: Boolean for every column foo in the table.
However, I was discussing with @mgallagher last night that a better approach would be to replace the Condition plugin and implement a strongly typed filter in a similar vein to what you suggest - we even agreed that Mongo filters would be a good model to follow. The schema for such a thing might end up looking something like this:
type MyTable {
  id: ID!
  name: String!
  createdAt: DateTime!
  updatedAt: DateTime!
  number: Int
  json: JSON
}

type MyTableCondition {
  id: IDFilter
  name: StringFilter
  createdAt: DateTimeFilter
  updatedAt: DateTimeFilter
  number: IntFilter
  json: JSONFilter
  and: MyTableCondition
  or: MyTableCondition
}

type StringFilter {
  null: Boolean
  eq: String
  ne: String
  gt: String
  gte: String
  lt: String
  lte: String
  in: [String!]
  nin: [String!]
}

type IntFilter {
  null: Boolean
  eq: Int
  ne: Int
  gt: Int
  gte: Int
  lt: Int
  lte: Int
  in: [Int!]
  nin: [Int!]
}

type DateTimeFilter {
  null: Boolean
  eq: DateTime
  ne: DateTime
  gt: DateTime
  gte: DateTime
  lt: DateTime
  lte: DateTime
  in: [DateTime!]
  nin: [DateTime!]
}

type JSONFilter {
  null: Boolean
}

type MyTableConnection {
  ...
}

type Query {
  allMyTables(condition: MyTableCondition): MyTableConnection!
}

schema {
  query: Query
}

@mattbretl Your feedback looks well structured, however I don't see any difference functionality with the original poster proposal with mongoDB style except you probably saved one level of nesting hell.
My understanding based on previous discussion is that the current way of structuring is very limited in the expressibility, therefore we are limited just by types of operations that a suffix or a object key can represent. And PostgreSQL has so much more that doesn't depends solely on just the operations, there are a lot of aggregate functions, or buildin functions that allows much more richer comparisons.
As it is impossible to keep up to date on those extensions, all possible comparison between json, string, float, integers, etc, it is in my opinion wiser to start with giving more expressibility first, then start making it more universal.
As for AND and OR, what your syntax is exactly the same what I seen on Scaphold, as you assumed each array within the And and Or keyword are all wrapped with paranthesis, but what if I just simply want to do A and B or C? How would you describe that in that syntax?
I'm not saying the idea is bad, but it is limiting and probably not reaching the goals and standards that both @benjie and @calebmer set.

The great thing about doing this with a v4 plugin is we can have multiple implementations and people can choose to use the one they prefer. There's no need to have the plugin in core at all - it can be a completely independent npm module.
If the community vote enough on a particular plugin then we could even merge it into core (if the author agrees!).
I might do a dissection of the plugin above so people can see how it works. It's not as hard as it looks - a lot of it is boilerplate.

@benjie Just to make sure I follow, your strongly typed filter approach:
type MyTableCondition {
  id: IDFilter
  name: StringFilter
  createdAt: DateTimeFilter
  updatedAt: DateTimeFilter
  number: IntFilter
  json: JSONFilter
  and: MyTableCondition
  or: MyTableCondition
}

would allow queries like:
{
  authorId: { eq: 2 },
  topic: { in: [SHOWCASE, INSPIRATION] },
  createdAt: { gt: "2017-07-01T00:00:00Z" }
}

whereas my approach (with Mongo syntax):
type MyTableCondition {
  ...
  name_null: Boolean
  name_eq: String
  name_ne: String
  name_gt: String
  name_gte: String
  name_lt: String
  name_lte: String
  name_in: [String!]
  name_nin: [String!]
  ...
}

would allow queries like:
{
    authorId: 2
    topic_in: [SHOWCASE, INSPIRATION]
    createdAt_gt: "2017-07-01T00:00:00Z"
  }

If I'm seeing this clearly, both approaches provide the same filtering capabilities.  The difference is my schema is denormalized for the sake of slightly simpler queries (replacing three {,:,} characters with one _).  If we were writing the GraphQL schema from scratch instead of generating it from Postgres, yours would obviously be preferable because it's properly normalized and therefore much easier to maintain.  Yours is also more extensible, e.g. StringFilter could be extended to accomplish the type of thing that @pencilcheck was proposing.  Yours also provides a better GraphiQL experience, since you'd be picking from a short field list,and then an short operator list, instead of one giant list.  So, based on the mountain of evidence in your favor, you win.  🎉
@pencilcheck, I agree with your comments on extensibility of the filter model.  I think @benjie's most recent proposal would address your concerns.  Since StringFilter is an object, we could eventually add support for filters like { description: { gt: 5, functions: ['charLength'] } } which translates to char_length(description) > 5.  (That's just one idea, you could structure that object several different ways.)
In comparison, your { leftOperand, operator, rightOperand, parseClass } approach is flexible, but it abandons strong typing and it feels like it's leading us toward eval() land.  I don't see any benefits to it over @benjie's strongly typed proposal.
I also took another look at your parseClass concept and I think I have a better grasp of the motivations now.  My main concern would be the amount of logic required to confirm that the parseClass integer values given by the user actually constitute a valid execution order.  I haven't really thought it through, so maybe it's no big deal.  My secondary concern is whether it's actually any easier to write/interpret a big parseClass-style filter versus than the nested and/or filters.  I'd have to experiment with a longer list of examples.
As an aside, huge thanks to @benjie for leading the charge on v4 so we can explore all of these tangents indepedently of core.  👏

(Just added not: MyTableCondition to the above example, may be able to drop a few fields due to that (e.g. nin: [1,2] could become not: {in: [1,2]}).)
Thanks @mattbretl :)
I think our solutions are broadly similar. I also agree we should probably go with the longer names @mattbretl suggest because clarity > brevity.
To be clear: I am not writing any code for this right now. I might in future, but if someone else wants to step up please do. I'd recommend doing it as an additional arg (e.g. allFooBars(condition2: FooBarCondition2), but probably better named such as 'filter' or whatever) so it can be used side-by-side with the existing implementation to aid migrating.

@benjie sorry for asking in this thread but can you point out the resources/links to get started? I am just a postgraphql user and I have no idea how the v4 plugin structure is going to work. And it doesn't seems like there are organized resources on actionable examples I can follow to get this started.
Cheers

@pencilcheck I'm still working on the docs over at https://graphile.org but it's very time consuming and I'm doing it unpaid. First thing you should do is familiarise yourself with Facebook's  graphql-js library for writing a schema manually  because if you don't know that you won't understand Graphile Build.

If you want to support me writing more docs (and making the existing ones make more sense!); donations are gratefully received: https://www.paypal.me/benjie

I really like graph.cool's query parameter syntax, which is also a little reminiscent of Mongo's query operators and uses the filter arg:
query actorsAfter2009 {
  allActors(
    filter: {
      movies_some: {
        releaseDate_gte: "2009"
      }
    }
    first: 3
    orderBy: name_ASC
  ) {
    name
    movies {
      title
    }
  }
}

@benjie, is your quick-and-dirty plugin available on branch or will I need to cobble that together? My team kind of hit a wall today when we realized the need to support filtering and the current approach to use stored procedures is less viable due do the data models we're dealing with (whole lotta tables).
The Graph.cool guys are "happy to share our best practices designing powerful GraphQL APIs with the GraphQL community", so I wonder if this might be a point of convergence?

The plugin is available in full above, to load it see:
https://www.graphile.org/postgraphile/extending/#loading-additional-plugins
This works with postgraphql@next (v4) which is the same as postgraphile.

Here's my first shot at a v4 plugin:
module.exports = function PgConnectionArgFilter(
  builder,
  { pgInflection: inflection }
) {
  builder.hook(
    "init",
    (
      _,
      {
        addType,
        getTypeByName,
        newWithHooks,
        pgIntrospectionResultsByKind: introspectionResultsByKind,
        pgGqlInputTypeByTypeId: gqlTypeByTypeId,
        graphql: { GraphQLInputObjectType, GraphQLBoolean, GraphQLInt, GraphQLString, GraphQLNonNull, GraphQLList },
      }
    ) => {
      const makeFilterFields = (gqlType) => {
        return {
          null: {
            description: "If set to true, checks for null values.  If set to false, checks for non-null values.",
            type: GraphQLBoolean,
          },
          equalTo: {
            description: "Checks for values equal to this value.",
            type: gqlType,
          },
          notEqualTo: {
            description: "Checks for values not equal to this value.",
            type: gqlType,
          },
          lessThan: {
            description: "Checks for values less than this value.",
            type: gqlType,
          },
          lessThanOrEqualTo: {
            description: "Checks for values less than or equal to this value.",
            type: gqlType,
          },
          greaterThan: {
            description: "Checks for values greater than this value.",
            type: gqlType,
          },
          greaterThanOrEqualTo: {
            description: "Checks for values greater than or equal to this value.",
            type: gqlType,
          },
          in: {
            description: "Checks for values that are in this list.",
            type: new GraphQLList(new GraphQLNonNull(gqlType)),
          },
          notIn: {
            description: "Checks for values that are not in this list.",
            type: new GraphQLList(new GraphQLNonNull(gqlType)),
          },
        };
      };

      const StringFilter = new GraphQLInputObjectType({
        name: "StringFilter",
        description: `A filter to be used against String fields. All fields are combined with a logical ‘and.’`,
        fields: makeFilterFields(GraphQLString),
      });
      addType(StringFilter);

      const IntFilter = new GraphQLInputObjectType({
        name: "IntFilter",
        description: `A filter to be used against Int fields. All fields are combined with a logical ‘and.’`,
        fields: makeFilterFields(GraphQLInt),
      });
      addType(IntFilter);

      const DatetimeFilter = new GraphQLInputObjectType({
        name: "DatetimeFilter",
        description: `A filter to be used against Datetime fields. All fields are combined with a logical ‘and.’`,
        fields: makeFilterFields(getTypeByName("Datetime")),
      });
      addType(DatetimeFilter);

      const JSONFilter = new GraphQLInputObjectType({
        name: "JSONFilter",
        description: `A filter to be used against JSON fields. All fields are combined with a logical ‘and.’`,
        fields: {
          null: {
            description: "If set to true, checks for null values.  If set to false, checks for non-null values.",
            type: GraphQLBoolean,
          }
        }
      });
      addType(JSONFilter);

      introspectionResultsByKind.class.map(table => {
        const tableTypeName = inflection.tableType(
          table.name,
          table.namespace && table.namespace.name
        );
        newWithHooks(
          GraphQLInputObjectType,
          {
            description: `A filter to be used against \`${tableTypeName}\` object types. All fields are combined with a logical ‘and.’`,
            name: `${inflection.tableType(
              table.name,
              table.namespace && table.namespace.name
            )}Filter`,
            fields: ({ fieldWithHooks }) =>
              introspectionResultsByKind.attribute
                .filter(attr => attr.classId === table.id)
                .reduce((memo, attr) => {
                  const fieldName = inflection.column(
                    attr.name,
                    table.name,
                    table.namespace && table.namespace.name
                  );
                  const fieldFilterTypeByFieldTypeName = {
                    String: StringFilter,
                    Int: IntFilter,
                    Datetime: DatetimeFilter,
                    JSON: JSONFilter
                  }
                  const fieldType = gqlTypeByTypeId[attr.typeId];
                  const fieldFilterType = fieldFilterTypeByFieldTypeName[fieldType.name];
                  if (fieldFilterType != null) {
                    memo[fieldName] = fieldWithHooks(
                      fieldName,
                      {
                        description: `Filter by the object’s \`${fieldName}\` field.`,
                        type: fieldFilterType,
                      },
                      {
                        isPgConnectionFilterInputField: true,
                      }
                    );
                  }
                  return memo;
                }, {}),
          },
          {
            pgIntrospection: table,
            isPgFilter: true,
          }
        );
      });
      return _;
    }
  );
  builder.hook(
    "GraphQLObjectType:fields:field:args",
    (
      args,
      {
        pgSql: sql,
        gql2pg,
        extend,
        getTypeByName,
        pgIntrospectionResultsByKind: introspectionResultsByKind,
      },
      {
        scope: { isPgConnectionField, pgIntrospection: table },
        addArgDataGenerator,
      }
    ) => {
      if (!isPgConnectionField || !table || table.kind !== "class") {
        return args;
      }
      const TableFilterType = getTypeByName(
        `${inflection.tableType(
          table.name,
          table.namespace && table.namespace.name
        )}Filter`
      );

      addArgDataGenerator(function connectionFilter({ filter }) {
        return {
          pgQuery: queryBuilder => {
            if (filter != null) {
              introspectionResultsByKind.attribute
                .filter(attr => attr.classId === table.id)
                .forEach(attr => {
                  const fieldName = inflection.column(
                    attr.name,
                    table.name,
                    table.namespace.name
                  );
                  const fieldFilter = filter[fieldName];
                  if (fieldFilter != null) {
                    Object.keys(fieldFilter).forEach(operator => {
                      const sqlField = sql.fragment`${queryBuilder.getTableAlias()}.${sql.identifier(attr.name)}`;
                      if (operator === "null") {
                        queryBuilder.where(
                          sql.fragment`${sqlField} ${fieldFilter[operator]
                            ? sql.fragment`IS NULL`
                            : sql.fragment`IS NOT NULL`}`
                        );
                      } else if (operator === "equalTo") {
                        queryBuilder.where(
                          sql.fragment`${sqlField} = ${gql2pg(fieldFilter[operator], attr.type)}`
                        );
                      } else if (operator === "notEqualTo") {
                        queryBuilder.where(
                          sql.fragment`${sqlField} <> ${gql2pg(fieldFilter[operator], attr.type)}`
                        );
                      } else if (operator === "lessThan") {
                        queryBuilder.where(
                          sql.fragment`${sqlField} < ${gql2pg(fieldFilter[operator], attr.type)}`
                        );
                      } else if (operator === "lessThanOrEqualTo") {
                        queryBuilder.where(
                          sql.fragment`${sqlField} <= ${gql2pg(fieldFilter[operator], attr.type)}`
                        );
                      } else if (operator === "greaterThan") {
                        queryBuilder.where(
                          sql.fragment`${sqlField} > ${gql2pg(fieldFilter[operator], attr.type)}`
                        );
                      } else if (operator === "greaterThanOrEqualTo") {
                        queryBuilder.where(
                          sql.fragment`${sqlField} >= ${gql2pg(fieldFilter[operator], attr.type)}`
                        );
                      } else if (operator === "in") {
                        const list = sql.join(
                          fieldFilter[operator].map(val => gql2pg(val, attr.type)),
                          ", "
                        );
                        queryBuilder.where(
                          sql.fragment`${sqlField} IN (${list})`
                        );
                      } else if (operator === "notIn") {
                        const list = sql.join(
                          fieldFilter[operator].map(val => gql2pg(val, attr.type)),
                          ", "
                        );
                        queryBuilder.where(
                          sql.fragment`${sqlField} NOT IN (${list})`
                        );
                      }
                    });
                  }
                });
            }
          },
        };
      });

      return extend(args, {
        filter: {
          description:
            "A filter to be used in determining which values should be returned by the collection.",
          type: TableFilterType,
        },
      });
    }
  );
};

This adds a new filter: arg and does not change the existing condition: arg.  I believe I've implemented everything in @benjie 's proposal above, with the exception of logical operators (and/or/not).
If anyone wants to try this out, you can save the code above as PgConnectionArgFilter.js and use the --append-plugins option in the CLI (making sure to use postgraphql@next):
postgraphql --append-plugins '/path/to/PgConnectionArgFilter.js'

Further testing and feedback would be greatly appreciated.

This is super cool and I was actually looking for this already :+1:
What do you think if you name the operators according to the query selector from mongodb? https://docs.mongodb.com/manual/reference/operator/query/#query-selectors
They seem to be a sort of standard these days...
I don't have time to try this out now, but have a look next week.

This looks really promising! 🎉
Please change lines such as:
const StringFilter = new GraphQLInputObjectType({...});
addType(StringFilter);

to:
const StringFilter = newWithHooks(GraphQLInputObjectType, {...}, {
  isFilterInputType: true,
  filterType: GraphQLString,
});

This way additional plugins can extend these filters e.g. to add full text search or whatever.
Personally I'd split this into multiple plugins so that "equality" is in the base plugin and other features can be added additively so people can pick and choose which filters they want. The null filter could be added to all isFilterInputTypes via a small plugin, for example, rather than duplicating it for each type as is performed currently.
I'd also split the base filter types (StringFilter, JSONFilter, etc) into their own plugin as they should be valid outside of PostgreSQL (i.e. split your first hook in half).
I'd move fieldFilterTypeByFieldTypeName onto the Build object (using a build hook) so that other plugins can register more filter types here and everything can benefit.
It would be nice to have isDistinctFrom and isNotDistinctFrom added too; but this should be done as a separate plugin as it has performance consequences so people might not want to implement it by default.
I don't have time to review the code in depth right now; hopefully these quick notes are helpful!
Thanks so much for implementing this 🙏

(In general GraphQL API's tend to use more verbose/descriptive field names rather than short abbreviated ones, so I support using greaterThanOrEqualTo: over gte:; GraphQL tools can help auto-complete these for you so it shouldn't be much more effort for the programmer and it's easier to read.)

Haven't fully tested the code but added DateFilter
https://gist.github.com/pencilcheck/cb71850937c0341a9b06a7f8fdee14fd

I just started a new repo for this effort:
https://github.com/mattbretl/postgraphile-filter-plugins
Improvements:

[x] Support and and or logical operators.
[x] Support additional types: Date, Time
[x] Support additional operators: isDistinct, isDistinctFrom
[x] Allow Mongo-style operator names by toggling a const at the top of the plugin.. I don't plan to use these personally, but I don't want to exclude anyone based on naming conventions.  We can have another debate if/when this reaches the PR stage.

In the process of adding logical operators, this basically became a full rewrite.  The build object now has a filterOperators object which holds all of the filtering logic, including how they resolve to SQL.  If you take a quick look at PgConnectionArgFilterOperatorsPlugin.js, you'll see how easy it is to add/remove operators or restrict an operator's availability to specific field types.  For now, that's the basic way to customize this plugin for a specific use case.
Next on my list:

[ ] Allow overriding of filterable field types (Int, String, etc.) via a hook
[ ] Add tests using the kitchen sink schema

@benjie, please let me know if there's a better way to structure this plugin; I'm sure there's plenty of room for improvement.  I considered your suggestion of including the equalTo operator by default and adding other operators as separate plugins, but that dovetailed into a set of questions about whether each operator should be a separate plugin, how to group them, what to call them, etc., so for now they're all included by default.

Allow Mongo-style operator names by toggling a const at the top of the plugin..

Rather than using const useShortNames = false; you can/should make it a plugin option, e.g.:
module.exports = function PgConnectionArgFilterOperatorsPlugin(builder, { connectionFilterUsesShortNames = false } = {}) {

See: https://www.graphile.org/graphile-build/plugins/#plugin-arguments

you'll see how easy it is to add/remove operators or restrict an operator's availability to specific field types

This statement makes me happy 😁

let me know if there's a better way to structure this plugin

Looks good from a quick scan 👍 You could expose an index.js which automatically composes these plugins, assuming they can just be appended to the list? That would make it easier to consume. You could also publish it to npm so people can just install and use graphile-build-pg-contrib-connection-filter or whatever.

Rather than using const useShortNames = false; you can/should make it a plugin option

Your improvement exposes the option to buildSchema(plugins, options), but as far as as I can tell, the options passed when calling postgraphql don't pass through to buildSchema.  What am I missing?

postgraphile-core acts as a gateway, you can use graphqlBuildOptions to pass through additional options (this will be renamed soon)
https://github.com/graphile/graphile-build/blob/master/packages/postgraphile-core/src/index.js

👍 Updated the repo

Thanks for this update @mattbretl , could you give an example on how you'd do this request from the front end, we keep getting blocked with "argument filter has invalid value" - at the moment we're doing requests as
exampleRequest(filter: {
equalTo: {
jobs: {
rate: 27
}
}
})

I think it’s the other way around: filter { rate { equalTo: 27 }} ?

@benjie's example should work, assuming it fits your schema.  Did you intend to nest 'rate' under 'jobs'?  At the moment, the plugin doesn't support querying on nested (related) fields.
Also, please make sure you're using the latest master from https://github.com/mattbretl/postgraphile-filter-plugins..  I committed a few fixes last week.

@benjie @mattbretl thank you so much for your feedback!
It should be filter { rate { equalTo: 27 }} my apologies for the nesting.
Yes we pulled down the latest from master and started with the index file - we're getting a Uuid issue, but i'm assuming so thats a problem pertaining to our end
Thanks nonetheless!

Do feel free to raise that as a separate issue if you can't get to the bottom of it 👍

Absolutely will do @benjie , thanks for the support and feedback! This has saved my team weeks of work!

@benjie Turns out theres been a change from Uuid to UUID which was crashing our app when we upgraded to v4! :)

That is mentioned in the breaking changes in #506; if someone fancied writing them up as an article on graphile.org that'd be welcome - probably easier to reference!

I've just opened up the wiki and created a page for community plugins - if you're aware of any others please post them on the wiki!
https://github.com/postgraphql/postgraphql/wiki/v4-plugins

@benjie is this issue the best one for generic search? Sounds like currently the best option is to build a plugin for this still, unless you're ok with making custom sql functions

hmmm. could this be the solution to search and filter? https://github.com/mattbretl/postgraphile-plugin-connection-filter

maybe should officially support or mention on this page: https://www.graphile.org/postgraphile/filtering/

I'm closing this; if you need this functionality then @mattbretl's plugin is the best bet, and I've added it to the filtering docs as @pyramation suggested 👍


Arch Linux packages

I created packages for Arch Linux in the AUR.
stable: https://aur.archlinux.org/packages/spotify-web-player/
development: https://aur.archlinux.org/packages/spotify-web-player-git/
Could you add links in the install section?
Thanks.

Sure, glad to see some Arch activity :+1: I would love to distro-hop to Arch again sometime in the future but maybe when I have lots of free time to set everything up :smile:

@twa022 the packages disappeared from the AUR. What happened to them? Are you planning to put them on again?


About  item click event an error problem.

When adding the Header, and then set the Item click event will appear by clicking on the Header is an error to collapse, only add the if (position < 0) return;To solve it, don't know whether the authors can modify this problem,thanks.

I'm not sure If I understand it correctly. Can you elaborate it? A code snippet would be great.


Move v2 to root

Motivation for changes:
Instead of getting rid of webuv1 right away (#2556), I'd like to move webui_v1 to /v1/ and v2 to /
Detailed changes:

Move / -> v1
Redirect /v1/api -> /api
Move /v2 -> /

Config usage if relevant (new plugin or updated schema):
web_server:
   run_v1: yes

Remember to increase version number for flexget. From run_v1 should probably drop the v1

I think that a minor flexget version bump would be in order


Question on role assignment limit

The page says:

Maximum user role assignments per application | 200 | This limit isn't the same as the number of users per application.

Currently we have been using individual 'Assign User'. Does that mean with this approach the effective user limit is 200 (if each user had max 1 role assignment)? And if we were to need more than 200 we should implement AAD groups (eg 1 group is only 1 role assignment)

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: bb7148d2-782c-a5a5-f6d2-8bea7732a119
Version Independent ID: 66187383-537b-570d-2fbf-3db1db215f5b
Content: Azure IoT Central quotas and limits - Azure IoT Central
Content Source: articles/iot-central/core/concepts-quotas-limits.md
Service: iot-central
GitHub Login: @dominicbetts
Microsoft Alias: dobett

@jochemdevos
Thanks for your feedback! We will investigate and update as appropriate.

@jochemdevos
Yes, that's correct. The maximum number of user role assignments per application is 200, which means that if you use individual 'Assign User' to assign roles to users, the effective user limit is 200. If you need more than 200 users to have roles assigned, you should consider using Azure Active Directory (AAD) groups.
Using AAD groups is a good approach to manage access to resources in Azure IoT Central. You can create a group and assign a role to the group, and then add users to the group. This way, you can manage access to resources for a large number of users more efficiently.
For example, if you have 100 users who need to access a resource in Azure IoT Central, you can create a group and assign the role to the group. Then, you can add all 500 users to the group, and they will automatically inherit the role assigned to the group. This way, you can manage access to the resource for all 100 users using just one role assignment.
The following limitations apply to Azure Active Directory groups and service principals:
Total number of Azure Active Directory groups for each IoT Central application can't be more than 20.
Total number of unique Azure Active Directory groups from the same Azure Active Directory tenant can't be more than 200 across all IoT Central applications.
Service principals that are part of an Azure Active Directory group aren't automatically granted access to the application. The service principals must be added explicitly.
Please see Manage users and roles in your IoT Central application for more details.
Hope this helps.


Saved video file only has one video frame

Ran the sample on a Galaxy S6. The video file is saved, but when pulling the video file and playing it on the desktop it only has audio and 1 frame of video. The video appears to be frozen in playback.
Any ideas? Perhaps the surface list is not getting updated correctly by the background handler in the capture session? The preview surface is updated correctly, just not the mediarecorder surface.

update. when I view the files saved on the device something weird happens. The audio plays completely and then the video animates after the audio completes. When you look at the video playback controls the video starts when it looks like the playback is at the end of the video. Could this be an issue with how I have setup the mediarecorder? I have repro'ed this on two devices.

If I do not configure the audio source on the media recorder then the video plays back as expected. Once I add the MIC source to the media encoder the problem appears.

I am having the same issue. @twisnowski did you manage to fix this?

@saurabharora90 Sorry, no fix. Do you still see the issue?

@twisnowski yes I still see it

I'm running into a similar issue with my Galaxy S7 Edge running Marshmallow.
I've got the Galaxy Tab S2 9.7 running Lollipop and it runs on that no problem. I've also tested on my Nexus 7 LTE running Marshmallow and it runs on that as well.
I'm guessing this must be a limitation or some kind of change in the code that Samsung made with Touchwiz on the Marshmallow.
Has anyone had any luck getting this to work on their Samsung? I'm unable to even get the Mediarecorder to run through prepare if I try to omit the setting of the audiosource.

The issue is a deep sleep problem on some devices running Marshmallow. It appears to be CPU related as an S7 on Verizon doesn't have the issue, but an S7 on AT&T does have the issue. I've seen this on an S6 Verizon phone when it updated to Marshmallow.
In order to replicate, reboot a device while connected to USB. Run the sample. All should be ok. Then, disconnect the device, let it go into deep sleep (screen off, no movement for 5? minutes), and try again. The issue will appear once the device has gone into deep sleep.
The root cause is that the first sample of the recorded video has a duration that is ginormous, making the player believe the first frame should be displayed for a very long time, which is the symptom of it looking like just one frame of video. Use mp4parser and look at the video track's decodingTimes. You can see the difference from a good and bad decoding time in the attached files.

I understand this is a known issue in deep sleep but cannot find the issue quickly on google developers. I'm currently trying to use mp4parser to rewrite that one sample's duration, but I'm not an expert mp4parser guy.

Interesting. I tried doing the reboot and you are right, it worked like a charm. Really weird.
I may have to delve a little deeper...
Thanks for the insight!

Here is my fix. For a 5 minute recording on an S6, it was about a 700MB mp4 file. This processing took about 20 seconds to read and rewrite that file:
        DataSource channel = new FileDataSourceImpl(rawFile);
        IsoFile isoFile = new IsoFile(channel);

        List<TrackBox> trackBoxes = isoFile.getMovieBox().getBoxes(TrackBox.class);
        boolean sampleError = false;
        for (TrackBox trackBox : trackBoxes) {
            TimeToSampleBox.Entry firstEntry = trackBox.getMediaBox().getMediaInformationBox().getSampleTableBox().getTimeToSampleBox().getEntries().get(0);

            // Detect if first sample is a problem and fix it in isoFile
            // This is a hack. The audio deltas are 1024 for my files, and video deltas about 3000
            // 10000 seems sufficient since for 30 fps the normal delta is about 3000
            if(firstEntry.getDelta() > 10000) {
                sampleError = true;
                firstEntry.setDelta(3000);
            }
        }

        if(sampleError) {
            Movie movie = new Movie();
            for (TrackBox trackBox : trackBoxes) {
                    movie.addTrack(new Mp4TrackImpl(channel.toString() + "[" + trackBox.getTrackHeaderBox().getTrackId() + "]" , trackBox));
            }
            movie.setMatrix(isoFile.getMovieBox().getMovieHeaderBox().getMatrix());
            Container out = new DefaultMp4Builder().build(movie);

            //delete file first!
            FileChannel fc = new RandomAccessFile(rawFile.getName(), "rw").getChannel();
            out.writeContainer(fc);
            fc.close();
            Log.d(TAG, "Finished correcting raw video");
        }

I've also come across the same issue, glad to see it's not just me! The fix above worked great for me, however I need the recorded video to be played on some older device's HTML video elements (which don't support the ISO type, just plain old MP4s).
I'm wondering @cybaker , as you mentioned the initial 'deep sleep' problem, if you had any further insight into what's actually causing the problem? How did you come to the conclusion? Is there anything low level that can be accessed to analyse/control this behaviour? i.e, is there a way to "kick" the device and media recorder out of this glitchy state?

I am having the same issue too..so sad!!

Any update on this issue?

@cybaker getting NPA function getMovieBox() on line
 List<TrackBox> trackBoxes = isoFile.getMovieBox().getBoxes(TrackBox.class);

I'm getting same issue in both S6 and S7.
Video has complete audio but 1 frame of video. It appears to be frozen in playback.

@cybaker Can you tell me what tool you using to parser MP4.

I am also getting the same issue, is there are any fix for this, getting this on my production application.

Hello
I am also facing the same issue for all samsung devices.
I also tried this given by @cybaker but the same issue which is mentioned in comment .
Apart from the above also tried below things using mp4 parser but still the issue is not resolved.(7 seconds track converted to more thn 30 mnts by trying below things and given by @cybaker )

Extracted audio track from video
Extracted video track from video
Merged Video And Audio

If anyone can get solutions please post it.
Thanks

My Verizon Galaxy S7 Edge on 7.0 has the same issue.

Has anyone been able to find a solution?

I run android-Camera2Video in s6 and s7 video recorded and save in sdcard. but when we preview the saved  video then video freeze but sound played. Kindly let me know what is the solution for given devices.

F**k Samsung!

Can't playing video frames but good on audio result.
Video frames only running after audio playing completed.
To make this sample running fine, i must restart my phone before.
Confused :(

@cybaker I've tried your solution and it works. Thanks a lot

@cybaker I have tried your solution but still not working. Is this gonna be solved at some point?

@cybaker Seems mp4parser is removing the MPEG header, it is the only difference I can see between the original file and the one generated with your code.

This is before I convert the file

This is after:

Huh I also I encountered this issue on my S7. It was weird because I was running the same code I uploaded on it days prior to the error. Then resetting the phone (not a hard reset) got rid of the issue.
So so very confused

Hi everyone:
Lots of questions and I've been off that project for two years. I believe it to be only a Samsung issue as it doesn't happen on other manufacturer phones I was testing like LG, Motorola, and Google Pixels, something to do with their recording software using the wrong real time counter. Android now has multiple real time clocks and if the device ever deep sleeps even once the clocks will differ by the deep sleep amount. There's plenty of documentation about it in Android Alarms so check it out if you need more info. It is for Samsung to fix and maybe they have in their own video playback software without fixing the recording side. That is too bad for us developers.
My fix above is still working as far as I know. I'm out of that company and don't have access to the particular version of mp4parser but I believe it was up to date 2 years ago. All that needs to be done is rewrite the duration of that first frame and the issue is solved, but in order to do that it is easiest to read in the entire file and rewrite but it takes time with a video file.
I wish you all luck with Samsung as they touch so many OS parts.

This issue is also present on my Samsung J5 Prime (SM-G570M) running Android platform 7.0 Nougat (API 24). The bug can be reproduced by following the steps pointed by @cybaker

I had the same issue with a Samsung J5. While I can't fix the record side, at least I was able to restore the video using ffmpeg and these command line options:
Windows: .\ffmpeg.exe -i "broken.mp4" -vf setpts=N/FRAME_RATE/TB "fixed.mp4"
Unix: ffmpeg -i "broken.mp4" setpts=N/FRAME_RATE/TB "fixed.mp4"
To be perfectly honest, I have NO idea what setting the presentation timestamps means, but it fixed the video for me. (Note: if your frame rate is not fixed, replace FRAME_RATE with the target frame rate, like 30 for example.)

FYI the presentation timestamp is how long the video frame is presented to the screen, how long it is shown on screen until the next frame. Frames should normally be presented around 33 msec for a 30 frames per second recording. In the Samsung error case, the first frame's timestamp is huge (in my example 88813322 instead of about 3000). So for that error the first frame of the video will be presented to the screen for a duration of about 8881 times longer than normal. That is why playing the video seems to be stuck, the first frame is shown on the screen for a really long time instead of the usual 1/30th of a second. The audio continues playing because it's a different decoding stream.

A short term temporary fix is to use Camera API (I know it it deprecated) to record videos instead of Camera2. It worked for me.

I had the same issue. I was using Camera 1 API and configured audio source to use CAMCORDER, the video would appear frozen. When I changed the audio source to MIC, the video and audio play correctly.
People who are using camera 1 API, can try this solution.

Waking up the cpu (PARTIAL flag) before starting the capture worked for me. Using Camera2.
[https://developer.android.com/training/scheduling/wakelock]
PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE);
WakeLock wakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
"MyApp::MyWakelockTag");
wakeLock.acquire();

Anyone has good solution directly in java Android code?

I am also looking for a solution. It should be pretty simple, since many other video recording apps (like instagram or other camera apps) work without a problem.

What helped me on Samsung A7 in that situation was changing the:
setAudioEncoder(MediaRecorder.AudioEncoder.AAC)
to
setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT)
when setting up the mediaRecording.

This sample has been migrated to a new location where we can accept Pull Requests (check README for more information).
As recommended by GitHub, we are closing all issues and pull requests now that this older repo will be archived.
If you still see this issue in the updated repo, please reopen the issue/PR there. Thank you!


Allow registerCallback on array of paths

This adds support for registering a callback to multiple paths.

Hi @jenssegers , thanks for the PR :)
I think I'de prefer this to be in a seperate function called registerCallbacks so that $paths can be type hinted as an array
The logic is sound though, so just needs moving to a new function
Thanks again :)

There is already a function called registerCallbacks, but registerCallback made more sense to me as -you are registering a single callback to multiple tags.

Appologies @jenssegers , it's been a while since I last looked at this and I'd forgotten about the registerCallbacks method
Ok.. let's add this functionality into registerCallback as it does seem to make sense.
Could you add a supporting unit test as well? Once that's done, I'll merge in this PR
Thanks!

Hi @jenssegers , Could I get a small unit test for this change please? Once done I'll merge it in and get a release out with your changes :)


Add support for Ghostty terminal emulator

Add Ghostty colors and configuration as well as a very short readme to explain how to set it up.

can you share some screenshots, please and thank you?
On Sunday, October 27th, 2024 at 4:49 PM, Jorge B @.***> wrote:

Add Ghostty colors and configuration as well as a very short readme to explain how to set it up.

You can view, comment on, or merge this pull request online at:
https://github.com/AlexvZyl/nordic.nvim/pull/160
Commit Summary

f05b6a0 Add Ghostty configuration and colors

File Changes
(2 files)

A platforms/ghostty/README.md (12)
A platforms/ghostty/nordic (27)

Patch Links:

https://github.com/AlexvZyl/nordic.nvim/pull/160.patch
https://github.com/AlexvZyl/nordic.nvim/pull/160.diff

—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: @.***>

Here are a couple of screenshots as well as one from neovim to compare:

Sweet, thanks @.
Why did you modify source files?  That should not be relevant to this PR.


feat: Cherry pick susmita

What type of PR is this? (check all applicable)

[x] 🍕 Feature
[ ] 🐛 Bug Fix
[x] 📝 Documentation Update
[ ] 🎨 Style
[ ] 🧑💻 Code Refactor
[ ] 🔥 Performance Improvements
[ ] ✅ Test
[ ] 🤖 Build
[ ] 🔁 CI
[ ] 📦 Chore (Release)
[ ] ⏩ Revert

Description
This PR moves project utilities to the docs folder.

Related Tickets & Documents

Fixes issue #166
closes #201
Mobile & Desktop Screenshots/Recordings

Added tests?

[ ] 👍 yes
[x] 🙅 no, because they aren't needed
[ ] 🙋 no, because I need help

Added to documentation?

[ ] 📜 README.md
[x] 📓 docs.opensauced.pizza
[ ] 🍕 dev.to/opensauced
[ ] 📕 storybook
[ ] 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?
No
[optional] What gif best describes this PR or how it makes you feel?

 Do I need to do anything?

Nope


Game Speed Improvements

These queries are slow, replace Database.queryGames with a function to return a single game, and a function to return all games of a given user.
You can write a method in database and then replace the Database.getQueryResult(...) line with Database.theFunctionsYouWrite.
If that doesn't work just push it to a feature branch and assign this back to me, I'll take a look.
Please PR when you're done coz there's some cleanup I need to do regarding batched queries.
        // returns a single game
        // TODO: update docs
        app.get('/api/game', (req, res) => {
            const { gameId } = req.query;
            Database.getQueryResult(Database.queryGames, { id: gameId })
            .then((games) => {
                res.json({games});
            });
        });

        // return all games for a given user
        app.get('/api/agent-games', (req, res) => {
            const { agentId } = req.query;
            Database.getQueryResult(Database.queryGames, { agentScores: agentId })
            .then((games) => {
                res.json({games});
            });
        });

i think these work ok? what are u using to quantify slow?

Query of the speed with regards to number of games.
Given N games these both run in O(N) time


chore: fix package.json files

This is the result of running npm pkg fix (npm v10+) on each workspace package.json file. Also adds a missing repository field to the root workspace package.json.

[!WARNING]
This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

Current dependencies on/for this PR:

main

PR #818

PR #819   👈

This stack of pull requests is managed by Graphite.

@leotm I don't understand if there's anything actionable here, per your comments.
npm pkg fix is seemingly not a thing that VS Code can do via codeActionsOnSave.  There may be an extension for it.  Regardless, prettier should be formatting on save and as a pre-commit hook (run npm run setup if you don't have the hooks installed).

@leotm I don't understand if there's anything actionable here, per your comments.

updating the branch (via rebase) removed my commit :(
created follow-up PR here

https://github.com/LavaMoat/LavaMoat/pull/833

the line range (61-103) seemed too wide to comment in a GH suggestion

npm pkg fix is seemingly not a thing that VS Code can do via codeActionsOnSave. There may be an extension for it. Regardless, prettier should be formatting on save and as a pre-commit hook (run npm run setup if you don't have the hooks installed).

ah i see, saving the file is simply formatting (updating order), not removing dupe config (npm pkg fix)


Need an API to determine when Python is still busy discovering interpreters

Based on our previous discussions I was informed that calling refresh on the new Python API would be a noop if Python has already started the refresh. Thus we'd get a promise back letting us know if and when python has completed refreshing/loading the interpreters.
However based on the latest discussions this is not the case.
Here's what was previously discussed:

https://github.com/microsoft/vscode-jupyter/issues/7583#issuecomment-1238574479
change getRefreshPromise to getRefreshPromise(): Promise | undefined;
Where getRefreshPromise returns an existing promise instead of starting a whole new refresh. Note, refreshEnvironments is a separate method.
The UI here also requires jupyter to know whether a refresh in Python is already in progress
https://github.com/DonJayamanne/kernel-python-picker

This is what we need:

If Python is busy discovering interpreters we need to know this
It doesn't need to be a promise, it could be an event along with a status property (as previously discussed),
This way the change even triggers when theres' a change in the state
and a status property contains the current status refreshing|idle|etc...

@karrtikr this is something we wanted in the previous API, hence filing this as a bug.

Based on our previous discussions I was informed that calling refresh on the new Python API would be a noop if Python has already started the refresh. Thus we'd get a promise back letting us know if and when python has completed refreshing/loading the interpreters.
However based on the latest discussions this is not the case.

There's been some misunderstanding again, if Python already started a refresh and Jupyter calls the refresh API, the same promise is returned, i.e you would get a promise back letting you know if and when python has completed.
But the Python extension only starts a refresh on startup the first time the extension is loaded.
Let's discuss some alternatives, like Jupyter only automatically starting a refresh when the kernel picker is opened. My understanding is this can now be done as the kernel picker is now simply a quickpick.

Note: for now i'm calling the refresh method in Python Extneion API as soon as extension loads.
This is something we used to do and then removed 2 weeks ago, bringing this back now.
I don't think its good for us to call refresh unnecessarily as this could cause other I/O (perf) issues, as a discovery is invoked unnecessarily (which is somethign I hope to avoid)

Refresh without force is only once per session

Hence calling this n additional times will have no effect

When we have a refresh button on Kernel Quick pick we should call refresh with force
Suggestion is to call refresh upon display of kernel quickpick
TODO: solve issue with IW


Use stable AzureAD PS module for Set-AzureADMSAuthorizationPolicy

The command Set-AzureADMSAuthorizationPolicy is now available in AzureAD module (althoug this is not documented yet, see https://github.com/Azure/azure-docs-powershell-azuread/issues/713).
I suggest that the commands be adapted to the new syntax, and that users are encouraged to use the stable version whenever possible.

Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ID: c7a6c58c-f887-03a4-8f69-eb91a19e4fb3
Version Independent ID: 4e53d964-7edf-5668-b976-75fcdce4638e
Content: Configure how end-users consent to applications using Azure AD
Content Source: articles/active-directory/manage-apps/configure-user-consent.md
Service: active-directory
Sub-service: app-mgmt
GitHub Login: @davidmu1
Microsoft Alias: davidmu

@commakoerschgen
Thanks for your feedback! I've assigned this issue to the author who will investigate and update as appropriate.

#reassign:@omondiatieno

Reassigning to the PM responsible for this to help with translating the current cmdlet in the article to the  proposed one with the correct syntax.
#reassign: @psignoret


[feature] Allow MOON_TOOLCHAIN_FORCE_GLOBALS to be configured per toolchain

Is your feature request related to a problem? Please describe.
Moon simplifies toolchain installing which is great, especially for more complex cases like rust, in CI environment however that can be slow or in case of node unreliable. MOON_TOOLCHAIN_FORCE_GLOBALS is escape hatch in case you already have installed everything, to skip extra work. But rust setup is harder, node setup is easy, but installing with moon unreliable. So I would want to install rust with moon, but use global node, best of both worlds.
Describe the solution you'd like
Make MOON_TOOLCHAIN_FORCE_GLOBALS configurable per toolchain, so basically everything global except rust in my case, or add option auto so when node version matches it uses global if it doesn't exist it downloads it.

You can now pass names in 1.28:
MOON_TOOLCHAIN_FORCE_GLOBALS=node,etc


Username and Password added

Modified Home.md

@xadahiya Please review.

@xadahiya Please review and merge if it is okay.

I think username and password have been deprecated by the new Token-based system. See Auth


Add findFirst to list of batchable functions

Apparently, findFirst calls are also batched when occurring in the same tick and having the same where and include parameters. Wouldn't it be good to update the Query Optimization article so that users know about that ?
(I only learnt about it because I wanted to check if batching findMany calls was a soon to come feature. So I searched for the corresponding github issue which fortunately included a link to the issue where findFirst got batched)

I am not sure this is actually true. findOne (now called findUnique) and findFirst are different things.

Hey @cunisia 👋 thanks for opening this issue! I'm aware that it has been around for a while but we're only now getting to a major cleanup of the docs repo, so apologies for the delay. I'm closing this issue as it seems to be outdated, but please feel free to open other issues in the future if you notice anything that can be improved in the Prisma docs 🙏


Data race on aws_logger global var

Describe the bug
When multiple SDK service clients are created simultaneously on different threads, a data race can be observed on the aws_logger global variable, where one thread is setting the var & another attempts to read it before the set is complete.  Data race can be observed in the Xcode Thread Sanitizer.

Expected Behavior
Exclusive access to the logger should be enforced while it is set.
Current Behavior
Simultaneous get & set access happens, as seen in the screenshot above.
Reproduction Steps
Turn on Xcode thread sanitizer.
Create multiple file-based configurations on different threads.
Observe race condition shown above.
Possible Solution
No response
Additional Information/Context
No response
aws-crt-swift version used
0.33.0
Compiler and Version used
Xcode 15.4
Operating System and version
macOS 14.6.1

Ensuring proper use and initialization of aws-crt-swift's underlying C dependencies cannot be a responsibility of aws-crt-swift consumers.  When aws-crt-swift is used in a multithreaded environment, it should ensure that it dependencies' API requirements are met.

Ensuring proper use and initialization of aws-crt-swift's underlying C dependencies cannot be a responsibility of aws-crt-swift consumers. When aws-crt-swift is used in a multithreaded environment, it should ensure that it dependencies' API requirements are met.

While I agree with the statement, I can think of a few options, such as putting a lock around it or making the re-initialization a no-op to fix it on the CRT side. I will look into making this a better experience, but it won't change the fact that the CRT logger is global and not client-level, and should not be exposed as such. The use case of having a different logger for different clients won't work with CRT's current logger. If client A initializes the logger with TRACE level and client B initializes it with ERROR level, it will override client A's logger with client B's, since there is only one global logger.

This is fixed in https://github.com/awslabs/aws-crt-swift/releases/tag/v0.35.0.


Mega merge

Several PRs became intertwined w/ overlapping changes

EfficientNet-X /  MobileNet-v4 (#2123)
ViTamin (#2193 #2169 )
MobileCLIP (#2189 )

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.


Letter units ('k', 'm', etc) in inputs no longer work

When entering values in an input unit letters like 'k', 'm', etc no longer working.
Pressing Enter no longer applies the input.

Fixed by passing the WaveGen channel index into formatInputAndUpdate.
commit: 6f5876c


Proxy Connection Failed in Edge

I'm running Edge on macOS Ventura with an M1 MacBook Pro.  The extension works fine on Firefox, but on Edge no matter what I select I get an error:
"Proxy Connection Failed.  Could not connect to… "

Looks like the API changed. The SOCKS hostnames used to be provided without the .mullvad.net suffix, which is why it's doubled up in your screenshot.
I've fixed this and uploaded a new Firefox version for review, but I'm not going to update the Edge version for now since their review process is kinda tedious and they've stopped accepting Manifest V2 extensions apparently, which probably means some bigger changes.
Here's a packaged version you can sideload, though:
mullvad_proxy_unofficial_-0.2.4.zip

@hensm Thank you so much for the prompt response!  Added the extension to Edge and it's working fine.  You rock!


feat: add MarkupString support in FluentDataGrid

🙋 Feature Request
Add support for MarkupStrings to be rendered within FluentDataGrid cells when the content is populated through PropertyColumns.
🤔 Expected Behavior
MarkupString objects can be used in FluentDataGrids so that additional HTML can be dynamically rendered within cells.
😯 Current Behavior
Currently, trying to pass in MarkupString objects with HTML tags results in the HTML being rendered as plaintext.
💁 Possible Solution
It looks like the PropertyColumn currently passes a string to the render tree builder that is created from the _cellTextFunc. This function is defined to return a string, so even setting the TProp type param as MarkupString does not do anything.
One potential solution could be a switch parameter added to PropertyColumn, and if true, use a different cell text function that outputs a MarkupString. Another solution could be to add special logic that checks if TProp is MarkupString, and if so, do the same.
🔦 Context
I'm querying data that has text occasionally containing links (i.e., "https://..."). This data is displayed in a FluentDataGrid, but as it is now, the links are plaintext and are not hyperlinked. I have logic in place to identify these snippets and wrap them with HTML a tags and cast them to MarkupStrings, but PropertyColumn converts these back to strings before any of the markup parsing can take place.
💻 Examples
<fluent-data-grid-cell cell-id="c10" cell-type="default" grid-column="4" class="col-justify-start multiline-text" title="..." aria-label="..." b-w6qdxfylwy="" tabindex="-1" role="gridcell" style="grid-column: 4;">
  #shadow-root (open)
  "Most Azure services and client SDKs include a retry mechanism. However, these differ because each service has different characteristics and requirements, and so each retry mechanism is tuned to a specific service

  Reference: https://learn.microsoft.com/en-gb/azure/architecture/best-practices/retry-service-specific#azure-storage-retry-guidelines"

</fluent-data-grid-cell>

What if I just change the CellContent method to
protected internal override void CellContent(RenderTreeBuilder builder, TGridItem item)
=> builder.AddContent(0, new MarkupString(_cellTextFunc?.Invoke(item) ?? string.Empty));

Gives me this when cpoying your example in the multiline text content example:

Don't see any adverse effects on any of the other examples.
Thoughts?

Looks like that would work well! I think there should be a way to disable it though (or have it disabled by default) in case that the cell content is being populated by data from an untrusted source and it happens to have malicious HTML. Especially since the official Blazor docs note this when using MarkupString: https://learn.microsoft.com/en-us/aspnet/core/blazor/components/?view=aspnetcore-8.0#raw-html:~:text=Rendering raw HTML constructed from any untrusted source is a security risk and should always be avoided.

Agree. Was looking at that too. Maybe add an overloaded method so we don't break existing implementations

I'm implementing it like this:
 protected internal override void CellContent(RenderTreeBuilder builder, TGridItem item)
 => builder.AddContent(0, _cellTextFunc?.Invoke(item));

 protected internal override void CellContent(RenderTreeBuilder builder, TGridItem item, bool allowRawHtml)
 => builder.AddContent(0, new MarkupString(_cellTextFunc?.Invoke(item) ?? string.Empty));

So a new overloaded method and a new bool AllowRawHtml parameter.
When using this new variant on a TemplateColumn it throws a NotImplementedException as it is not possible to pass the parameter to the ChildContent it renders.

Why not use a TemplateColumn with MarkupString, if you have HTML content?
Example.
<FluentDataGrid Items="@people">
    <PropertyColumn Property="@(p => p.PersonId)" Sortable="true" />
    <PropertyColumn Property="@(p => p.Name)" Sortable="true" />
    <TemplateColumn Sortable="true" Class="multiline-text">
        @((MarkupString)context.Description)
    </TemplateColumn>
</FluentDataGrid>

@dvoituron thanks for the suggestion, just tested it with my use case and that does work. I think there would be value in having an "allow HTML" parameter to PropertyColumn like Vincent suggested because it's not obvious (to me) that the property is always converted to a string thanks to the _cellTextFunc (even a MarkupString).
But maybe the use case of wanting to parse/render raw HTML inside a DataGrid is too rare to warrant a new feature like that. My use case is solved, so I'll be happy either way.

Oh, I'll add that the built-in sorting of PropertyColumn is convenient :)

We'll keep it as-is. TemplateColumn solves the issue. If some extra work is then needed for sorting, then so be it.


RFM - Android Studio

Current Maintainer

[x] I am the maintainer of the package and wish to pass it to someone else;

I DON'T Want To Become The Maintainer

[x] I have followed the Package Triage Process and I do NOT want to become maintainer of the package;
[x] There is no existing open maintainer request for this package;

Checklist

[x] Issue title starts with 'RFM - '

Existing Package Details
Package URL: https://chocolatey.org/packages/AndroidStudio
Package source URL: https://github.com/jtcmedia/chocolatey-packages/tree/master/androidstudio
The download for this is now behind a modal that you have to scroll through and check a box at the bottom to accept the license agreement. I use AU and I don't know how to get around this for automated updates or if it's even legal to.

I am happy to pick this one up - Chocolatey user name is dgalbraith

@dgalbraith I believe I have added you as a maintainer. You just need to approve. My repo has the current package https://github.com/jtcmedia/chocolatey-packages/tree/master/androidstudio if you want a starting point.

Package and history have been migrated with the initial version now pushed using the new repository source.


Fixing array missing items and type missing on items

This pull requests has a valid SailPoint IIQ API specification. It also contains a lot of smaller changes made by our YAML Linter. I will update it next week to only include the meaningful changes to pass the API Spec validation.

The code in this repository is autogenerated from an internal repo, so we cannot accept PRs. Please open an issue instead.

Hi @colin-mckibben-sp just in case this was missed, you ask me to create this pull request as part of #48 :-)


FIX: delete transition all on lib components

PR includes

[x] Bug Fix

Related issues

Resolve #170
QA Instructions, Screenshots, Recordings
Please replace this line with instructions on how to test your changes, a note on the devices and browsers this has been tested on, as well as any relevant images for UI changes.

/canary

Canary available<EMAIL_ADDRESS>


Add security policy doc

fixes https://github.com/open-cluster-management/backlog/issues/2495

/assign pmorie

/approve
/lgtm