Unit test fail because of external factor (Azure Account)

I just saw that recent tests were failing because there was something wrong with the Amazon account (zero balance)
See: https://travis-ci.org/openlabs/Microsoft-Translator-Python-API/builds/62703439
microsofttranslator.TranslateApiException: The Azure Market Place Translator Subscription associated with the request credentials has zero balance. : ID=5641.V2_Json.Translate.2820E7BA

The test should not be dependent on a live service. We should use mocks instead.

---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/15899651-unit-test-fail-because-of-external-factor-azure-account?utm_campaign=plugin&utm_content=tracker%2F588721&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F588721&utm_medium=issues&utm_source=github).

@Ecno92 while I agree that mock is the ideal case, there is incentive to testing with the service itself. We discovered the module had issues with an API microsoft changed some time ago for example.
To prevent abuse, I have moved the key from source code (test file) to an environment variable on Travis. This will make the builds fail for pull requests, but once merged they should pass.

When the builds fail on a pull request I think that using CI becomes quite useless.
I just found out that you can use after_script, after_succes and after_failure in the travis yaml file which run after the test and do not affect the test result.
In this way you can test with mocks and give some additional feedback in the log file of the test which shows if the test still run in a real situation.
I can help you with updating the travis.yml file in order to work in this way. Keep in mind that it may take some time before I have the PR ready since I don't have much time for this.


New Comments doesn't save after APO Enabled

We are using the internal wordpress comment system and after enabled the APO, everything looks perfect except comments. I feel that after We didn't get any comment a few days, and disabled immediately. After disabled APO, comment system works fine again.
I think, cached files doesn't post the comments to database because of not dynamic page or etc.
Can you confirm that?

@negativedh Thanks for bringing this to our attention - we're working on resolving this now.
The issue is new comments are not currently triggering a cache purge. All comments should still be getting save as far as we know.

My problem isn't purging the page for see the new comments already.
Problem is, comments don't post to database so i can't show them in admin panel even.

Interesting - I'm not able to reproduce that on my end.
Can you locate the request in the network tab within inspect element and see if you notice anything strange?

This was fixed in v3.8.5. Sorry for the trouble!

This was fixed in v3.8.5. Sorry for the trouble!

Which one fixed?
I think that job fixes to flush the cache when new comment send.
But my problem is, comments aren't posting to wordpress database, that fix including too ?

We fixed the purging issue on comment save. We werent able to replicate the comments saving issue on our end.

Can you confirm that this only purges the page cache, not static objects?


Providing function descriptions in Module

Hi,
It's nice how it's possible to add a function description in the Names section, so that it appears as a tool tip when writing the formula in the Excel grid. Is there a way to define descriptions for functions in Modules too? I can't find it documented anywhere.
Thanks.

You can use leading /** */ comments.
/**
 My function that adds one
 */
add_one = LAMBDA(x, x + 1);

Thank you!
That's really great.


⚠ Samsung has degraded performance

In 96655e9, Samsung (https://samsung.com) experienced degraded performance:

HTTP code: 200
Response time: 3102 ms

Resolved: Samsung performance has improved in 78ebf23.


[Feature] New APP Request S3 Hookup

Notion ticket link

New APP Request S3 Hookup

Implementation description

Added next-s3-upload package
Used next-s3-upload hook to upload pdf to s3

Notes

Validation of upload done before form validation
Files will be stored in next-s3-upload/{random_uuid}/{filename} directory on bucket

Checklist

[x] My PR name is descriptive, is in imperative tense and starts with one of the following: [Feature],[Improvement] or [Fix],
[x] I have run the appropriate linter(s)
[x] I have requested a review from the RCD team on GitHub, or specific people who are associated with this ticket

Is the POA form URL change being reflected in the DB as well?

The url will need to be signed when it is displayed to the user (i.e when fetching the url on the frontend) as it will only be valid for a certain amount of time. I don't think that's in the scope of this PR though

Also, if there were changes that were made to .env, please add those additional fields to .env.sample too.

Good call will add that in!

poaFormObjectKey change in https://github.com/uwblueprint/richmond-centre-for-disability/pull/146/commits/391f5e7e050ec3b7f00142831ab437d91eadc529


Uncaught TypeError: Cannot read property 'location' of undefined upgrading from react-router-redux

I am updating from react-router-redux, and keep getting Uncaught TypeError: Cannot read property 'location' of undefined. I am not sure if this is a bug (I see similar errors caused by package version compatabilities, but mine look OK), or if my implementation of proptypes needs to change, or another issue is at play.
//package.json
    "prop-types": "15.7.2",
    "react": "16.8.6",
    "react-dom": "16.8.6",
    "react-redux": "6.0.0",
    "redux": "4.0.1",
    "redux-thunk": "2.2.0",

//app.js
import React from 'react';
import { connect } from 'react-redux';
import { push } from 'connected-react-router'
import classNames from 'classnames';
import PropTypes from 'prop-types';

class App extends React.Component {
    static propTypes = {
        isAuthenticated: PropTypes.bool.isRequired,
        isAdmin: PropTypes.bool.isRequired,
        children: PropTypes.shape().isRequired,
        dispatch: PropTypes.func.isRequired,
        location: PropTypes.shape({
            pathname: PropTypes.string
        })
    };

    static defaultProps = {
        location: undefined
    };

    logout = () => {
        this.props.dispatch(authLogoutAndRedirect());
    };

    goToIndex = () => {
        this.props.dispatch(push('/'));
    };

    goToLogin = () => {
        this.props.dispatch(push('/login'));
    };

    render() {
        const homeClass = classNames({
            active: this.props.location && this.props.location.pathname === '/'
        });
        const protectedClass = classNames({
            active: this.props.location && this.props.location.pathname === '/policy_controls'
        });
        const loginClass = classNames({
            active: this.props.location && this.props.location.pathname === '/login'
        });

        return (

                    ...

                    {this.props.children}

        );
    }
}

const mapStateToProps = (state, ownProps) => {
    return {
        isAuthenticated: state.auth.isAuthenticated,
        isAdmin: state.auth.isAdmin,
        location: state.router.location.pathname,
        pathname: state.router.location.pathname,
        search: state.router.location.search,
        hash: state.router.location.hash,
    };
};

export default connect(mapStateToProps)(App);
export { App as AppNotConnected };

//reducers/index.js
import { combineReducers } from 'redux';
import { connectRouter } from 'connected-react-router'
import authReducer from './auth';
import dataReducer from './data';

export default (history) => combineReducers({
    router: connectRouter(history),
    auth: authReducer,
    data: dataReducer,
});`

//index.js
import React from 'react';
import ReactDOM from 'react-dom';
import createHistory from 'history/createBrowserHistory';

import { authLoginUserSuccess } from './actions/auth';
import Root from './containers/Root/Root';
import configureStore from './store/configureStore';

const initialState = {};
const target = document.getElementById('root');

const history = createHistory();
const store = configureStore(initialState, history);

const node = (
    <Root store={store} history={history} />
);

const token = sessionStorage.getItem('token');
let user = {};
try {
    user = JSON.parse(sessionStorage.getItem('user'));
} catch (e) {
    // Failed to parse
}

if (token !== null) {
    store.dispatch(authLoginUserSuccess(token, user));
}

ReactDOM.render(node, target);

//store/configurestore.js
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */

import thunk from 'redux-thunk';
import { createLogger } from 'redux-logger';

import { createBrowserHistory } from 'history'
import { createStore, applyMiddleware, compose } from 'redux';
import { routerMiddleware } from 'connected-react-router';
import createRootReducer from '../reducers'

import rootReducer from '../reducers';
import DevTools from '../containers/Root/DevTools';

export const history = createBrowserHistory()

export default function configureStore(initialState, history) {
    const logger = createLogger();

    // Build the middleware for intercepting and dispatching navigation actions
    const reduxRouterMiddleware = routerMiddleware(history);

    const middleware = applyMiddleware(thunk, logger, reduxRouterMiddleware);

    const middlewareWithDevTools = compose(
        middleware,
        DevTools.instrument()
    );

    // Add the reducer to your store on the `router` key
    // Also apply our middleware for navigating
    const store = createStore(createRootReducer(history), initialState, middlewareWithDevTools);

    if (module.hot) {
        module.hot
            .accept('../reducers', () => {
                const nextRootReducer = require('../reducers/index'); // eslint-disable-line global-require

                store.replaceReducer(nextRootReducer);
            });
    }

    return store;
}

+1 this needs to be investigated. I tried using this library and followed the instructions and things are breaking, got this same bug as well, going to remove this library and move on for now.

+1 @cobyrne09 - did you find a solution to this?

@SavageWilliam I ended up rolling back a couple packages, and haven't had any trouble. I would try rolling back react-router-redux before redux or redux-thunk. I am guessing the only onee that matters is react-router-redux. I haven't had any issues with the alpha version. That said, I am sure something is going to force me to update sooner or later and I'll be sure to check back in on this thread when it does.
here are my current versions:
"prop-types": "15.7.2", "react": "16.8.4", "react-dom": "16.8.4",  "react-router-redux": "5.0.0-alpha.9",  "redux": "3.7.2",  "redux-thunk": "2.2.0",

+1
Am also facing this issue

Any solution for this issue ?

I don't have a proper solution for this, but I do have a hack that worked for me.
let history = { location: null };

if (typeof window === 'object') {
  history = createBrowserHistory();
}

I had the same issue today when I tried to migrate from react-router-redux to connected-react router.
For me the solution was that you need to provide the history param also in the hot reload part of your code.
if (module.hot) {
        module.hot
            .accept('../reducers', () => {
                const nextRootReducer = require('../reducers/index');
                store.replaceReducer(nextRootReducer(history));
            });
    }

There is also an example here: link


Highlighting

Sweet!

Now with configuration!

This just happened. No idea how :(

I've seen that before... sometimes things can slip out of sync.  Changing tabs will force it to rehighlight and so will continuing to type.

I rebased this branch against master and updated its getClientForEditor usage but editing became very very laggy :(
Hopefully its only my local rewrite that introduced this though. (not force pushing because I do not know what pending commits you have).

Maybe push it to a separate branch, and I can take a look when I have a moment?

Note depends on https://github.com/OmniSharp/omnisharp-roslyn/pull/251

I get the following error on startup with this branch
TypeError: Cannot read property 'registry' of undefined
  at /Users/jason/.atom/packages/omnisharp-atom/lib/omnisharp-atom/features/highlight.js:355:32
  at Object.<anonymous> (/Users/jason/.atom/packages/omnisharp-atom/lib/omnisharp-atom/features/highlight.js:363:3)
  at Module._compile (module.js:452:26)
  at Object.loadFile [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/babel.js:162:21)
  at Module.load (module.js:347:32)
  at Function.Module._load (module.js:302:12)
  at Module.require (module.js:357:17)
  at require (module.js:376:17)
  at Object.<anonymous> (/Users/jason/.atom/packages/omnisharp-atom/lib/omnisharp-atom/features/go-to-definition.js:5:19)
  at Module._compile (module.js:452:26)
  at Object.loadFile [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/babel.js:162:21)
  at Module.load (module.js:347:32)
  at Function.Module._load (module.js:302:12)
  at Module.require (module.js:357:17)
  at require (module.js:376:17)
  at /Users/jason/.atom/packages/omnisharp-atom/lib/omnisharp-atom/omnisharp-atom.js:141:29
  at /Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:4785:51
  at tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
  at InnerObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:4806:43)
  at InnerObserver.tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
  at AutoDetachObserverPrototype.next (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5274:51)
  at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:1710:35)
  at InnerObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5151:29)
  at InnerObserver.tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
  at AutoDetachObserverPrototype.next (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5274:51)
  at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:1710:35)
  at InnerObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:3627:90)
  at InnerObserver.tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
  at AutoDetachObserverPrototype.next (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5274:51)
  at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:1710:35)
  at InnerObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:4810:14)
  at InnerObserver.tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
  at AutoDetachObserverPrototype.next (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5274:51)
  at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:1710:35)
  at AsyncSubject.Rx.AsyncSubject.addProperties.onCompleted (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5484:17)
  at AsyncSubject.tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
  at AutoDetachObserverPrototype.completed (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5288:56)
  at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:1730:14)
  at AutoDetachObserver.tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
  at AutoDetachObserverPrototype.completed (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5288:56)
  at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:1730:14)
  at handler (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.async.js:373:20)
  at FSReqWrap.oncomplete (fs.js:77:15)

What was the action you were trying, go to definition?
Sent from Windows Mail
From: Jason Imison
Sent: Sunday, July 5, 2015 1:00 PM
To: OmniSharp/omnisharp-atom
Cc: David Driscoll
I get the following error on startup with this branch
TypeError: Cannot read property 'registry' of undefined
at /Users/jason/.atom/packages/omnisharp-atom/lib/omnisharp-atom/features/highlight.js:355:32
at Object. (/Users/jason/.atom/packages/omnisharp-atom/lib/omnisharp-atom/features/highlight.js:363:3)
at Module._compile (module.js:452:26)
at Object.loadFile [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/babel.js:162:21)
at Module.load (module.js:347:32)
at Function.Module._load (module.js:302:12)
at Module.require (module.js:357:17)
at require (module.js:376:17)
at Object. (/Users/jason/.atom/packages/omnisharp-atom/lib/omnisharp-atom/features/go-to-definition.js:5:19)
at Module._compile (module.js:452:26)
at Object.loadFile [as .js] (/Applications/Atom.app/Contents/Resources/app.asar/src/babel.js:162:21)
at Module.load (module.js:347:32)
at Function.Module._load (module.js:302:12)
at Module.require (module.js:357:17)
at require (module.js:376:17)
at /Users/jason/.atom/packages/omnisharp-atom/lib/omnisharp-atom/omnisharp-atom.js:141:29
at /Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:4785:51
at tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
at InnerObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:4806:43)
at InnerObserver.tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
at AutoDetachObserverPrototype.next (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5274:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:1710:35)
at InnerObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5151:29)
at InnerObserver.tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
at AutoDetachObserverPrototype.next (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5274:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:1710:35)
at InnerObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:3627:90)
at InnerObserver.tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
at AutoDetachObserverPrototype.next (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5274:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:1710:35)
at InnerObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:4810:14)
at InnerObserver.tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
at AutoDetachObserverPrototype.next (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5274:51)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onNext (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:1710:35)
at AsyncSubject.Rx.AsyncSubject.addProperties.onCompleted (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5484:17)
at AsyncSubject.tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
at AutoDetachObserverPrototype.completed (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5288:56)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:1730:14)
at AutoDetachObserver.tryCatcher (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:567:29)
at AutoDetachObserverPrototype.completed (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:5288:56)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.js:1730:14)
at handler (/Users/jason/.atom/packages/omnisharp-atom/node_modules/rx/dist/rx.async.js:373:20)
at FSReqWrap.oncomplete (fs.js:77:15)
—
Reply to this email directly or view it on GitHub.

This was just starting atom. I didn't perform any action.

I get the same error after the fix.


add an option to disable transactions for run and execute

i couldn't use the run and execute methods in the TypeORM plugin since TypeORM manages transactions itself. I could make it work somehow by pushing everything through the query method however as far as i see i can't get insertId and changes values through that. and it may break other things?
So would it be possible to use those methods without transactions? Possibly by parameter or by dedicated methods.

@chriswep this one i will have a look at it, i will add a parameter in the execute and run commands. this request has a value for all developers using the sqlite cordova plugin who will desire to migrate to the capacitor plugin.

@chriswep to resume, i will provide fixes for issue #106, #107 and #111  and only for release 3.0.x of the plugin, hope you will understand

@chriswep the fixes are available in release 3.0.0-beta.10 of the plugin. you can also look at https://github.com/jepiqueau/angular-sqlite-app-starter i added a test for issues #106,#107,#111. Hope this will help you for the TypeORM plugin.

thanks @jepiqueau
i tried it out and found the following bugs:

transaction is forced to true in those lines, effectively disabling the feature:

https://github.com/capacitor-community/sqlite/blob/master/src/definitions.ts#L973
https://github.com/capacitor-community/sqlite/blob/master/src/definitions.ts#L1010

dateTypes are still treated as SQLITE_FLOAT here: https://github.com/capacitor-community/sqlite/blob/master/ios/Plugin/Utils/UtilsSQLCipher.swift#L486 - if the check is removed it works. I'm not sure if this is intended or if you consider this a bug. I'll write a more detailed comment in the corresponding ticket.

@chriswep

transaction is force to true if not given, so all the developers codes will still work. but if you enter false, it will run without transaction  see https://github.com/jepiqueau/angular-sqlite-app-starter/blob/master/src/app/testissue111/testissue111.page.ts lines 81, 95, ...
in sqlite3.h it is SQLITE_FLOAT with a value of 2 and not SQLITE_REAL. this is the reason i used SQLITE_FLOAT

with const trans = transaction ? transaction : true; trans will always be truthy. What you want is const trans = typeof transaction !== 'undefined' ? transaction : true;. However i suppose a better style would be to provide a default value in the method definition. To make matters complete: In cases like this i name the variable such that undefined is equivalent to false to avoid this (e.g. withoutTransaction)
the issue here is not float or real, but that no (lossy) data conversion should happen here. I don't want to repeat the discussion started in #108, so we can go into more detail there if needed. In short: If a conversion is done, it needs to depend on the column value as well. Thats why in SQLite it's called type affinity. A quick fix would be to just remove the check for dateTypes in getColumnType, which then falls back to sqlite3_column_type(stmt, index) which should return the correct type for the data in the column.

@chriswep solve in 3.0.0-beta.11. Hope you will now give me a break


Adding 20 new actions to the connector

When submitting a connector, please make sure that you follow the requirements below, otherwise your PR might be rejected. We want to make you have a well-built connector, a smooth certification experience, and your users are happy :)

[x] I attest that the connector works and I verified by deploying and testing all the operations.
[x] I attest that I have added detailed descriptions for all operations and parameters in the swagger file.
[x] I attest that I have added response schemas to my actions, unless the response schema is dynamic.
[x] I validated the swagger file, apiDefinition.swagger.json, by running paconn validate command.
[x] If this is a certified connector, I confirm that apiProperties.json has a valid brand color and doesn't use an invalid brand color, #007ee5 or #ffffff. If this is an independent publisher connector, I confirm that I am not submitting a connector icon.

If you are an Independent Publisher, you must also attest to the following to ensure a smooth publishing process:

[ ] I have named this PR after the pattern of "Connector Name (Independent Publisher)" ex: HubSpot Marketing (Independent Publisher)
[ ] Within this PR markdown file, I have pasted screenshots that show: 3 unique operations (actions/triggers) working within a Flow. This can be in one flow or part of multiple flows. For each one of those flows, I have pasted in screenshots of the Flow succeeding.
[ ] Within this PR markdown file, I have pasted in a screenshot from the Test operations section within the Custom Connector UI.
[ ] If the connector uses OAuth, I have provided detailed steps on how to create an app in the readme.md.

@sriyen-msft we have made the changes you requested. We noticed a build error because we changed an action however this action is new and is not available in the certified connector so not a breaking change

@sriyen-msft we have made a few fixes and also added more actions. Please review

@sriyen-msft The build errors indicates a breaking change however these are new actions and it is not published so our users have not created any workflows with this.

@RjImpx Apologies for the delay in response, We have a high number of submissions and had to prioritize the connectors which were ready for production deployment. We are reviewing submissions one by one sorted by created date time.


Saving files: jpeg encoded image data / data URI scheme

Is it possible to save an encoded image instead of giving a image file path / url ?
For example, it would be nice to be able to do
$post->image= $encoded_image_data;
$post->save();
Because of the fact that my javascript app posts an "data:image/jpeg;base64" image to my controller.
Thanks in advance

Close. Was fixed in 69c5048.


ServiceBus tracing: fix current context when processing concurrent requests

When processing concurrently, process callback is scheduled and runs on  a different thread than subscriber of FluxTrace, making  scope disappear. This change fixes it for processor and also ensures that context does not leak for parallel receive.
It does not affect EventHubs.

API change check
API changes are not detected in this pull request.


Refactor VLM modules

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily receiving feedbacks. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Please describe the motivation of this PR and the goal you want to achieve through this PR.
Modification
Please briefly describe what modification is made in this PR.
BC-breaking (Optional)
Does the modification introduce changes that break the backward-compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
Checklist

Pre-commit or other linting tools are used to fix the potential lint issues.
The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
If the modification has a dependency on downstream projects of a newer version, this PR should be tested with all supported versions of downstream projects.
The documentation has been modified accordingly, like docstring or example tutorials.

the issue can be reproduced on this pr https://github.com/InternLM/lmdeploy/issues/2841

1. OpenGVLab/InternVL2-1B failed
from lmdeploy import pipeline
from lmdeploy.messages import PytorchEngineConfig
from lmdeploy.messages import TurbomindEngineConfig
from lmdeploy.vl import load_image

engine_config = TurbomindEngineConfig(quant_policy=4)
pipe = pipeline("/nvme/qa_test_models/OpenGVLab/InternVL2-1B",  backend_config=engine_config)

image = load_image('https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/tests/data/tiger.jpeg')
res = pipe(('describe this image', image))

error is
/opt/py3/lib/python3.10/site-packages/timm/models/layers/__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
  warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
Flash Attention 2.0 only supports torch.float16 and torch.bfloat16 dtypes, but the current dype in Qwen2ForCausalLM is torch.float32. You should run training or inference using Automatic Mixed-Precision via the `with torch.autocast(device_type='torch_device'):` decorator, or load the model with the `torch_dtype` argument. Example: `model = AutoModel.from_pretrained("openai/whisper-tiny", attn_implementation="flash_attention_2", torch_dtype=torch.float16)`
[TM][WARNING] [LlamaTritonModel] `max_context_token_num` is not set, default to 8192.

Convert to turbomind format:   0%|          | 0/24 [00:00<?, ?it/s]
Convert to turbomind format:  29%|██▉       | 7/24 [00:00<00:00, 68.80it/s]
Convert to turbomind format:  62%|██████▎   | 15/24 [00:00<00:00, 73.22it/s]
Convert to turbomind format:  96%|█████████▌| 23/24 [00:00<00:00, 74.93it/s]

terminate called after throwing an instance of 'std::runtime_error'
  what():  [TM][ERROR] CUDA runtime error: CUBLAS_STATUS_EXECUTION_FAILED /lmdeploy/src/turbomind/utils/cublasMMWrapper.cc:307

1. OpenGVLab/InternVL2-1B failed
from lmdeploy import pipeline
from lmdeploy.messages import PytorchEngineConfig
from lmdeploy.messages import TurbomindEngineConfig
from lmdeploy.vl import load_image

engine_config = TurbomindEngineConfig(quant_policy=4)
pipe = pipeline("/nvme/qa_test_models/OpenGVLab/InternVL2-1B",  backend_config=engine_config)

image = load_image('https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/tests/data/tiger.jpeg')
res = pipe(('describe this image', image))

error is
/opt/py3/lib/python3.10/site-packages/timm/models/layers/__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
  warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
Flash Attention 2.0 only supports torch.float16 and torch.bfloat16 dtypes, but the current dype in Qwen2ForCausalLM is torch.float32. You should run training or inference using Automatic Mixed-Precision via the `with torch.autocast(device_type='torch_device'):` decorator, or load the model with the `torch_dtype` argument. Example: `model = AutoModel.from_pretrained("openai/whisper-tiny", attn_implementation="flash_attention_2", torch_dtype=torch.float16)`
[TM][WARNING] [LlamaTritonModel] `max_context_token_num` is not set, default to 8192.

Convert to turbomind format:   0%|          | 0/24 [00:00<?, ?it/s]
Convert to turbomind format:  29%|██▉       | 7/24 [00:00<00:00, 68.80it/s]
Convert to turbomind format:  62%|██████▎   | 15/24 [00:00<00:00, 73.22it/s]
Convert to turbomind format:  96%|█████████▌| 23/24 [00:00<00:00, 74.93it/s]

terminate called after throwing an instance of 'std::runtime_error'
  what():  [TM][ERROR] CUDA runtime error: CUBLAS_STATUS_EXECUTION_FAILED /lmdeploy/src/turbomind/utils/cublasMMWrapper.cc:307

I found this issue occurred in main branch, too

@lvhan028 all vl models' quantization failed
CUDA_VISIBLE_DEVICES=5 lmdeploy lite auto_awq /nvme/qa_test_models/internlm/internlm-xcomposer2d5-7b --work-dir /nvme/qa_test_models/internlm/internlm-xcomposer2d5-7b-inner-4bits --batch-size 32
2024-12-11 11:28:20,708 - lmdeploy - INFO - xcomposer2.py:106 - matching type of ModelType.XCOMPOSER2D5
Traceback (most recent call last):
  File "/home/zhulin1/miniconda3/envs/v62new/bin/lmdeploy", line 8, in <module>
    sys.exit(run())
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/cli/entrypoint.py", line 42, in run
    args.run(args)
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/cli/lite.py", line 131, in auto_awq
    auto_awq(**kwargs)
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/lite/apis/auto_awq.py", line 90, in auto_awq
    vl_model, model, tokenizer, work_dir = calibrate(model,
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/lite/apis/calibrate.py", line 253, in calibrate
    vl_model, model, tokenizer = vl_model_with_tokenizer(model_path=model)
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/vl/model/builder.py", line 81, in vl_model_with_tokenizer
    vl_model = load_vl_model(model_path, with_llm).vl_model
AttributeError: 'Xcomposer2VisionModel' object has no attribute 'vl_model'

File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/vl/model/builder.py", line 81, in vl_model_with_tokenizer
vl_model = load_vl_model(model_path, with_llm).vl_model

Using load_vl_model(model_path,'backend', with_llm) should resolve the problem.

MiniCPM model error

from lmdeploy import pipeline
from lmdeploy.messages import PytorchEngineConfig
from lmdeploy.messages import TurbomindEngineConfig
engine_config = TurbomindEngineConfig(quant_policy=0)
pipe = pipeline("/nvme/qa_test_models/openbmb/MiniCPM-Llama3-V-2_5",  backend_config=engine_config)
res = pipe("describe this image<IMAGE_TOKEN>")

error is

Traceback (most recent call last):
  File "/home/zhulin1/test_llm.py", line 5, in <module>
    pipe = pipeline("/nvme/qa_test_models/openbmb/MiniCPM-Llama3-V-2_5",  backend_config=engine_config)
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/api.py", line 85, in pipeline
    return pipeline_class(model_path,
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/serve/vl_async_engine.py", line 33, in __init__
    self.vl_encoder = ImageEncoder(model_path,
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/vl/engine.py", line 36, in __init__
    self.model = load_vl_model(model_path,
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/vl/model/builder.py", line 67, in load_vl_model
    model = module(**kwargs)
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/vl/model/minicpmv.py", line 31, in __init__
    raise ValueError('Can not find `version` in config.json. '
ValueError: Can not find `version` in config.json. Please checkout the latest model

MiniCPM model error

from lmdeploy import pipeline
from lmdeploy.messages import PytorchEngineConfig
from lmdeploy.messages import TurbomindEngineConfig
engine_config = TurbomindEngineConfig(quant_policy=0)
pipe = pipeline("/nvme/qa_test_models/openbmb/MiniCPM-Llama3-V-2_5",  backend_config=engine_config)
res = pipe("describe this image<IMAGE_TOKEN>")

error is

Traceback (most recent call last):
  File "/home/zhulin1/test_llm.py", line 5, in <module>
    pipe = pipeline("/nvme/qa_test_models/openbmb/MiniCPM-Llama3-V-2_5",  backend_config=engine_config)
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/api.py", line 85, in pipeline
    return pipeline_class(model_path,
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/serve/vl_async_engine.py", line 33, in __init__
    self.vl_encoder = ImageEncoder(model_path,
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/vl/engine.py", line 36, in __init__
    self.model = load_vl_model(model_path,
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/vl/model/builder.py", line 67, in load_vl_model
    model = module(**kwargs)
  File "/home/zhulin1/miniconda3/envs/v62new/lib/python3.10/site-packages/lmdeploy/vl/model/minicpmv.py", line 31, in __init__
    raise ValueError('Can not find `version` in config.json. '
ValueError: Can not find `version` in config.json. Please checkout the latest model

"ValueError: Can not find version in config.json. Please checkout the latest model"
Just as the log shows, please download the latest model

Can we remove threadsafe here?:
https://github.com/InternLM/lmdeploy/blob/fdaa6019a55367f6f7f8afe8123ae415628a5201/lmdeploy/serve/gradio/vl.py#L74

Can we remove threadsafe here?:
https://github.com/InternLM/lmdeploy/blob/fdaa6019a55367f6f7f8afe8123ae415628a5201/lmdeploy/serve/gradio/vl.py#L74

I am not sure. cc @irexyc

fixed w4a16 and MiniCPM error.
vllm testcase are passed!

Can we remove threadsafe here?:
https://github.com/InternLM/lmdeploy/blob/fdaa6019a55367f6f7f8afe8123ae415628a5201/lmdeploy/serve/gradio/vl.py#L74

For vl gradio demo, we can remove this, but we should use async functions like other demos.


Bump octodns to 0.9.17 and ovh to 1.0.0

Bump ovh version to 1.0.0 to achieve python 3.10 support.

Thanks!


Introduce use_same_package_name

to use the specified name as GHC package name.
In some special cases (especially GHC boot libraries), the package name needs to be given as specified.

Maybe we can have more features related to this, to control the --this-unit-id flag.


Fix slideout get stuck when closing the app while sliding

###Description
When closing the app while sliding out the panel, the _currentOffsetX gets stuck in the previous setting but _moved gets set to false so it's an able to move the panel.

Coverage decreased (-2.8%) to 67.045% when pulling e79a573aec9c3d049800068ebb98ebfdd4afb5bb on FocusVision:hotfix/aj/fix-menu-stuck-in-ios into f60dfd731c7a67e32619dfceb2e9dd715f660a07 on Mango:master.

Accidently created a pr against the wrong repo.


[IOTDB-282] add "show version"

Please update docs.

You answer the client's show version sql by refering to a constant string in jdbc:
static final String GLOBAL_DB_VERSION = "0.9.0-SNAPSHOT";

That way, your current realization is actually showing the version of jdbc, not the server.
Maybe you should develop show client version and show server version to handle the two different versions. Or just show version but return both the client's and the server's versions.
What do other guys think?

i think the client version is show in shell ，like ./iotdb-client.sh -v ！
when you connect to server ，“show version” command is an sql，must return from server side

@LeiRui this is a server version. I have already changed it.

@LeiRui @liutaohua this is a server version. Returned JDBC version is before I force-push, I have already changed it. It actually uses
IoTDBConstant.VERSION

Got it. Thanks for your hard work.
I still have some suggestions:

If you change rpc.thrift, remember to update the rpc-changelist.md under the service-rpc module.
What about just disabling the getDatabaseProductVersion() method by throw an exception? Since the now returned result VERSION is meaningless anyway and this method is not used anywhere.
You better add some tests in the IoTDBMetadataFetchIT.

Besides, I find that the server version will appear in the client shell:

So I wonder if the user specifically wants to get the version information using jdbc? We better clarify what the user really wants.

By the way, let's can call it a day :)  You can reply me tomorrow.

done
done
done

Please check out.
I think users want to get the server version. @LeiRui

I think users want to get the server version. @LeiRui

Yes I think so. I am just a little confused since the server version already appears in the client shell. But this pr is ok anyway.

done

Good job. To be perfect, I expect you to add another test in the IoTDBMetadataFetchIT similar to showTimeseriesTest1 and showStorageGroupTest, because if you have noticed, these two tests use statement.execute(sql) instead of databaseMetaData.getColumns.
By the way, please help rename showTimeseriesTest1 to showTimeseriesTest for clarity.

if somebody to write gui client ，how to show server version @LeiRui

if somebody to write gui client ，how to show server version @LeiRui

Yes, that is the user case of this pr.

I think users want to get the server version. @LeiRui

Yes I think so. I am just a little confused since the server version already appears in the client shell. But this pr is ok anyway.

done

Good job. To be perfect, I expect you to add another test in the IoTDBMetadataFetchIT similar to showTimeseriesTest1 and showStorageGroupTest, because if you have noticed, these two tests use statement.execute(sql) instead of databaseMetaData.getColumns.
By the way, please help rename showTimeseriesTest1 to showTimeseriesTest for clarity.

Done

why not add the commit id within version?

why not add the commit id within version?

What is commit id and why add it?

why not add the commit id within version?

show version is for users, not developers.
Use case:
Suppose client-0.9.0 could connect both server-0.8.0 and server-0.9.0. And we add a sql in 0.9.0, users need to decide which sql they use based on the version.


update variable thermosatTemperatureSetpoint

Hello,following the example thermostat here:https://developers.google.com/assistant/smarthome/traits/temperaturesetting#sample-query-request-and-response
how can I update this variable with the value set in the google home app? otherwise every time I open the app I always see the value of the example of the link posted and not the temperature I set

If you change the temperature in the Google Home app, you should receive an EXECUTE request.

perfect thank you. one last question: when I start the app created for the first time, I have seen that the temperature is set only if I say at least once verbally set the thermostat on heating and set the temperature to tot degrees. I was hoping that this function was created automatically even just by clicking the heat mode from the google home app, but it seems to me that it is not possible at the moment or am I wrong? I hope I explained myself.

actually I tried several times but the icon remains transparent even if I click on the heat icon. it only works if I say the command set the temperature to tot degrees in that case it also creates the file in firebase automatically but manually this doesn't work only the first time.

When the device is first created does it have any states in its associated Firebase document?

as soon as the app is opened, the thermostat icon is transparent. once the heat mode is clicked, the thermostat status in the firebase is created immediately and automatically. the item that is not created is the setpoint, that to create it I have to ask google vocally to set the temperature and then the data will be created in the firebase and the app comes to life. My suggestion is to give the possibility to create the set point parameter since the user selects the thermostat mode

I also wanted to report a bug: the thermostat scale starts from 10 degrees and reaches 32 degrees. if you accidentally set a temperature of 5 degrees, google sets it but the app restarts continuously as soon as the user tries to open it, to unlock the app you need to set a value from 10 to 32 vocally.

I'm a bit confused by your screenshot. Are you running this sample for your thermostat? That's not the expected format for states.

I'm a bit confused by your screenshot. Are you running this sample for your thermostat? That's not the expected format for states.
yes, the photo shows the status values saved in the firebase

and this is a part of the js file:
{   id: '4',   type: 'action.devices.types.THERMOSTAT',   traits: [     'action.devices.traits.TemperatureSetting'   ],   name: {     defaultNames: ['Smart Thermostat'],     name: 'Thermostat ',     nicknames: ['Living Room Thermostat'],   },   deviceInfo: {     manufacturer: 'Sirius Cybernetics Corporation',     model: 't-1000',     hwVersion: '3.2',     swVersion: '11.4',   },   willReportState: true,   attributes: {     availableThermostatModes: 'off,on,heat,cool,heatcool',     queryOnlyTemperatureSetting: false,     thermostatTemperatureUnit: 'C',     commandOnlyTemperatureSetting: true   }, },
I had to set commandOnlyTemperatureSetting: true
otherwise the voice commands would not accept me and google replied that the device does not yet support this functionality. you confirm that it's okay to leave it on true?

You could leave it on true, although your state data may not be returning correctly in a QUERY request.

sorry, is there a codelabs thermostat to create the app that can be controlled by the assistant? I would like to integrate it to my esp8266 + dht22

If you follow the codelab and make sure to update the endpoint logic correctly it should provide a good start.

hi, I created this nodejs script but when I say set hot air, google's answer is: sorry but the device does not support this mode. However, I discovered that if I manually add the thermostMode: heat entry in the firebase, and then I ask google to put cold air, it does so and if I ask to set the temperature at 20 degrees it does so by creating the thermostatTemperatureSetpoint entry in the firebase. So I think the problem is how to get the thermostMode file to be created in firebase automatically once you ask google.
`/**

Copyright 2018 Google Inc. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

'use strict';
const functions = require('firebase-functions');
const {smarthome} = require('actions-on-google');
const {google} = require('googleapis');
const util = require('util');
const admin = require('firebase-admin');
// Initialize Firebase
admin.initializeApp();
const firebaseRef = admin.database().ref('/');
// Initialize Homegraph
const auth = new google.auth.GoogleAuth({
scopes: ['https://www.googleapis.com/auth/homegraph']
});
const homegraph = google.homegraph({
version: 'v1',
auth: auth
});
exports.fakeauth = functions.https.onRequest((request, response) => {
const responseurl = util.format('%s?code=%s&state=%s',
decodeURIComponent(request.query.redirect_uri), 'xxxxxx',
request.query.state);
console.log(responseurl);
return response.redirect(responseurl);
});
exports.faketoken = functions.https.onRequest((request, response) => {
const grantType = request.query.grant_type
? request.query.grant_type : request.body.grant_type;
const secondsInDay = 86400; // 60 * 60 * 24
const HTTP_STATUS_OK = 200;
console.log(Grant type ${grantType});
let obj;
if (grantType === 'authorization_code') {
obj = {
token_type: 'bearer',
access_token: '123access',
refresh_token: '123refresh',
expires_in: secondsInDay,
};
} else if (grantType === 'refresh_token') {
obj = {
token_type: 'bearer',
access_token: '123access',
expires_in: secondsInDay,
};
}
response.status(HTTP_STATUS_OK)
.json(obj);
});
const app = smarthome({
debug: true,
});
app.onSync((body) => {
return {
requestId: body.requestId,
payload: {
agentUserId: '123',
devices: [{
id: '4',
type: 'action.devices.types.THERMOSTAT',
traits: [
'action.devices.traits.TemperatureSetting',
  ],
    name: {
      defaultNames: ['Temp control'],
      name: 'Temperature Controller',
      nicknames: ['Termostato'],
    },
    deviceInfo: {
      manufacturer: 'Acme Co',
      model: 'acme-thermosat',
      hwVersion: '1.0',
      swVersion: '1.0.1',
    },
    willReportState: true,
    attributes: {
availableThermostatModes: 'off,on,heat,cool,heatcool',
queryOnlyTemperatureSetting: false,
thermostatTemperatureUnit: 'C',
commandOnlyTemperatureSetting: false
    },
  }],
},

};
});
const queryFirebase = async (deviceId) => {
const snapshot = await firebaseRef.child(deviceId).once('value');
const snapshotVal = snapshot.val();
return {
  thermostatMode: snapshotVal.TemperatureSetting.thermostatMode,
  thermostatTemperatureSetpoint: snapshotVal.TemperatureSetting.thermostatTemperatureSetpoint,
  thermostatTemperatureAmbient: snapshotVal.TemperatureSetting.thermostatTemperatureAmbient,
  thermostatHumidityAmbient: snapshotVal.TemperatureSetting.thermostatHumidityAmbient,
  thermostatTemperatureSetpointLow: snapshotVal.TemperatureSetting.thermostatTemperatureSetpointLow,
  thermostatTemperatureSetpointHigh: snapshotVal.TemperatureSetting.thermostatTemperatureSetpointHigh,
};

}
const queryDevice = async (deviceId) => {
const data = await queryFirebase(deviceId);
return {
thermostatMode: data.thermostatMode,
thermostatTemperatureSetpoint: data.thermostatTemperatureSetpoint,
thermostatTemperatureAmbient: data.thermostatTemperatureAmbient,
thermostatHumidityAmbient: data.thermostatHumidityAmbient,
thermostatTemperatureSetpointLow: data.thermostatTemperatureSetpointLow,
thermostatTemperatureSetpointHigh: data.thermostatTemperatureSetpointHigh,
};
}
app.onQuery(async (body) => {
const {requestId} = body;
const payload = {
devices: {},
};
const queryPromises = [];
const intent = body.inputs[0];
for (const device of intent.payload.devices) {
const deviceId = device.id;
queryPromises.push(queryDevice(deviceId)
.then((data) => {
// Add response to device payload
payload.devices[deviceId] = data;
}
));
}
// Wait for all promises to resolve
await Promise.all(queryPromises)
return {
requestId: requestId,
payload: payload,
};
});
const updateDevice = async (execution,deviceId) => {
const {params,command} = execution;
let state, ref;
switch (command) {
case 'action.devices.commands.ThermostatTemperatureSetpoint':
state = {thermostatTemperatureSetpoint: params.thermostatTemperatureSetpoint};
ref = firebaseRef.child(deviceId).child('TemperatureSetting');
break;
case 'action.devices.commands.ThermostatSetMode':
state = {thermostatMode: params.thermostatMode};
ref = firebaseRef.child(deviceId).child('TemperatureSetting');
break;
case 'action.devices.commands.ThermostatTemperatureSetRange':
state = {thermostatTemperatureSetpointLow: params.thermostatTemperatureSetpointLow,thermostatTemperatureSetpointHigh: params.thermostatTemperatureSetpointHigh};
ref = firebaseRef.child(deviceId).child('TemperatureSetting');
break;
}
return ref.update(state)
.then(() => state);
};
app.onExecute(async (body) => {
const {requestId} = body;
// Execution results are grouped by status
const result = {
ids: [],
status: 'SUCCESS',
states: {
online: true,
},
};
const executePromises = [];
const intent = body.inputs[0];
for (const command of intent.payload.commands) {
for (const device of command.devices) {
for (const execution of command.execution) {
executePromises.push(
updateDevice(execution,device.id)
.then((data) => {
result.ids.push(device.id);
Object.assign(result.states, data);
})
.catch(() => console.error(Unable to update ${device.id}))
);
}
}
}
await Promise.all(executePromises)
return {
requestId: requestId,
payload: {
commands: [result],
},
};
});
exports.smarthome = functions.https.onRequest(app);
exports.requestsync = functions.https.onRequest(async (request, response) => {
response.set('Access-Control-Allow-Origin', '*');
console.info('Request SYNC for user 123');
try {
const res = await homegraph.devices.requestSync({
requestBody: {
agentUserId: '123'
}
});
console.info('Request sync response:', res.status, res.data);
response.json(res.data);
} catch (err) {
console.error(err);
response.status(500).send(Error requesting sync: ${err})
}
});
/**

Send a REPORT STATE call to the homegraph when data for any device id
has been changed.
*/
exports.reportstate = functions.database.ref('{deviceId}').onWrite(async (change, context) => {
console.info('Firebase write event triggered this cloud function');
const snapshot = change.after.val();

const requestBody = {
requestId: 'ff36a3cc', /* Any unique ID /
agentUserId: '123', / Hardcoded user ID /
payload: {
devices: {
states: {
/ Report the current state of our thermostat */
[context.params.deviceId]: {
thermostatMode: snapshotVal.TemperatureSetting.thermostatMode,
thermostatTemperatureSetpoint: snapshotVal.TemperatureSetting.thermostatTemperatureSetpoint,
thermostatTemperatureAmbient: snapshotVal.TemperatureSetting.thermostatTemperatureAmbient,
thermostatHumidityAmbient: snapshotVal.TemperatureSetting.thermostatHumidityAmbient,
thermostatTemperatureSetpointLow: snapshotVal.TemperatureSetting.thermostatTemperatureSetpointLow,
thermostatTemperatureSetpointHigh: snapshotVal.TemperatureSetting.thermostatTemperatureSetpointHigh,
      },
    },
  },
},

};
const res = await homegraph.devices.reportStateAndNotification({
requestBody
});
console.info('Report state response:', res.status, res.data);
});
`

It seems like you should create your device in your onSync handler, since then the data will always be available.
app.onSync(async (body) => {
  // Create device
  await firebaseRef.child('123').set({
    thermostatMode: 'off'
    // TODO Other initial states
  })
  return {
    ...
  }
})

I tried as suggested now the command is created when the app is opened but if I put heat mode after a few seconds it turns off again why?
`const queryFirebase = async (deviceId) => {
const snapshot = await firebaseRef.child(deviceId).once('value');
const snapshotVal = snapshot.val();
if (deviceId == '4') {
// Create device
firebaseRef.child(deviceId).child('TemperatureSetting').set({thermostatMode: 'off'})
return {

  thermostatMode: snapshotVal.TemperatureSetting.thermostatMode,
  thermostatTemperatureSetpoint: snapshotVal.TemperatureSetting.thermostatTemperatureSetpoint,
  thermostatTemperatureAmbient: snapshotVal.TemperatureSetting.thermostatTemperatureAmbient,
  thermostatHumidityAmbient: snapshotVal.TemperatureSetting.thermostatHumidityAmbient,
  thermostatTemperatureSetpointLow: snapshotVal.TemperatureSetting.thermostatTemperatureSetpointLow,
  thermostatTemperatureSetpointHigh: snapshotVal.TemperatureSetting.thermostatTemperatureSetpointHigh
};

}`

The device state resets because you're resetting it. You should put the behavior in onSync so that it only is set the first time. Now you'll be changing the value continually because onQuery and queryFirebase are called frequently.

thank you the problem has been solved by following this indication.

I'd like to recycle an old tablet with Android 4.4 to hang on the wall as a thermostat display, but since the google home app is not compatible, I was thinking of creating a web app always with firebase. to integrate a screen with an adjustable thermostat and send the data to the firebase, what do you recommend?

https://codepen.io/simoberny/pen/wrGoZZ
I thought of such a thing. is there a way to be able to view devices both from the google home app and from an html page?

As the device state should be reflected on both your web app and Google's Home Graph (through your webhook), it should be possible to view the device in both locations with the same state.
However, this only applies to devices your webhook provides like the thermostat.

Would you be kind enough to explain how to do it please?

I'm not sure what you're trying to accomplish necessarily. You already have the Google Home supported.

my intention would be to have the possibility to control the thermostat from an html page so that you can resurrect a tablet with android4.4 and be able to control the thermostat from there.

Poiché lo stato del dispositivo deve riflettersi sia sull'app Web sia sul grafico principale di Google (tramite il webhook), dovrebbe essere possibile visualizzare il dispositivo in entrambe le posizioni con lo stesso stato.
Tuttavia, questo vale solo per i dispositivi forniti dal webhook come il termostato.

or better can you confirm if the same graphic header of the thermostat that we display in the google app, can be split in a mirror on an html page with the same graphics and css to be clear?

For accessing your Firebase from the web, I'd look at this getting started guide.
The Google Home app UI is not written in HTML and CSS, so you wouldn't be able to directly copy any controller UI from it.

Per accedere a Firebase dal Web, darei un'occhiata a questa guida introduttiva .
L'interfaccia utente dell'app Google Home non è scritta in HTML e CSS, quindi non sarai in grado di copiare direttamente l'interfaccia utente del controller da essa.

hello, that was exactly what i wanted to know. So I create an html file by integrating the firebase script and then I will make it read and write the data in my database in such a way as to have everything synchronized.
Thanks so much for the information.


fix(coil-extension): popup rendering when controls are toggled, fix #52

LGTM, some issues with CI


new vscode 1.17.1 bug

[Error - 17:01:38] Request textDocument/documentLink failed.
Message: Request textDocument/documentLink failed with message: Cannot read property 'version' of undefined
Code: -32603
[Error - 17:01:41] Request textDocument/completion failed.
Message: Request textDocument/completion failed with message: Cannot read property 'version' of undefined
Code: -32603
[Error - 17:01:42] Request textDocument/documentLink failed.
Message: Request textDocument/documentLink failed with message: Cannot read property 'version' of undefined
Code: -32603

VSCode Version: Code 1.17.1 (1e9d36539b0ae51ac09b9d4673ebea4e447e5353, 2017-10-10T14:24:41.632Z)
OS Version: Windows_NT ia32 10.0.14393
Extensions:

Extension
Author (truncated)
Version

vscode-intelephense-client
bme
0.7.2

npm-intellisense
chr
1.3.0

jsrefactor
cms
1.5.0

jshint
dba
0.10.15

vscode-eslint
dba
1.3.2

tslint
eg2
1.0.11

vscode-npm-script
eg2
0.2.1

php-intellisense
fel
1.5.1

php-project
Fro
2.2.0

beautify
Hoo
1.1.1

docthis
joe
0.4.8

node-module-intellisense
lei
1.4.0

code-beautifier
mic
1.7.2

vscode-less
mrm
0.6.3

csharp
ms-
1.12.1

debugger-for-chrome
msj
3.3.1

typescript-hero
rbb
1.5.0

php-formatter
Sop
0.2.4

quokka-vscode
Wal
1.0.68

wallaby-vscode
Wal
1.0.64

html-css-class-completion
Zig
1.10.0

Steps to Reproduce:

Just to hover a field.

Ok problem solve... dont know how... maybe coz i update vscode and didnt reboot. w/e


fix: validate user code has not expired

IAM-820
Validate that the user code has not expired. Due to circular imports (the session object is defined in the oauth2 package), I had to alter the persister logic to initialize the session, if a session object was not provided.

Non-blocking: do you think we could pull this check earlier, like before this line?
If so, I can change it in the ID token fix PR.

Non-blocking: do you think we could pull this check earlier, like before this line?

this makes sense, I moved the check


Compilation on Ionic

Compiling my Ionic application with your plugin in production mode I always get the following error:
Error: Error encountered resolving symbol values statically.
Calling function 'makeDecorator', function calls are not supported.
Consider replacing the function or lambda with a reference to an exported function,
resolving symbol Injectable in

<EMAIL_ADDRESS>
resolving symbol OpaqueToken in

<EMAIL_ADDRESS>

resolving symbol OpaqueToken in

<EMAIL_ADDRESS>

is it working in development mode ?

@bougarfaoui yes working in development mode this issue is related to AOT compiler.

@bougarfaoui @Limoli I think, In the library package.json file -  moving all "@angular/*" to peerDependencies may solve the issue.
"peerDependencies": {
    "@angular/common": ">=4.1.3",
    "@angular/compiler": ">=4.1.3",
    "@angular/compiler-cli": ">=4.1.3",
    "@angular/core": ">=4.1.3",
    "@angular/platform-browser": ">=4.1.3",
    "@angular/platform-browser-dynamic": ">=4.1.3"
  },

Thanks @narainsagar I got it working by moving to the ng-socket-io package from ng2-socket-io - working fine now!

@narainsagar Moving Angular dependencies under peerDependencies didn't solve the problem.
@mashhoodr How did you fix it?

@Limoli I updated to the newer npm package (from ng2-socket-io to ng-socket-io) - just remove and readd it should work.

I started with ng-socket-io, it still throws error with --aot .
Any updates on it?

@AmitPhulera  I just updated the module, and I compiled using --aot and it works fine.
I will close the issue, if anyone have any problem feel free to open it again , sorry for being late.


Tom's list

[x] 1.2.1. How to search the Global Discovery Catalogue to find Datasets

https://github.com/wmo-im/wis2-guide/blob/main/guide/sections/part1/data-consumer.adoc#how-to-search-the-global-discovery-catalogue-to-find-datasets

[x] 1.2.2. How to subscribe to notifications about availability of new data

https://github.com/wmo-im/wis2-guide/blob/main/guide/sections/part1/data-consumer.adoc#how-to-subscribe-to-notifications-about-availability-of-new-data

[x] 1.2.4. How to download data from the Global Cache and WIS nodes (with @6a6d74) replace with "How to download data"

https://github.com/wmo-im/wis2-guide/blob/main/guide/sections/part1/data-consumer.adoc#how-to-download-data-from-the-global-cache-and-wis-nodes

[x] 2.2.4. WIS Node reference implementation: wis2box

https://github.com/wmo-im/wis2-guide/blob/main/guide/sections/part2/wis2node.adoc#wis-node-reference-implementation-wis2box

[x] 2.3.5. Global Discovery Catalogue

https://github.com/wmo-im/wis2-guide/blob/main/guide/sections/part2/global-services.adoc#global-discovery-catalogue

[x] 4.1 Security (OpenAPI security schemes)

https://github.com/wmo-im/wis2-guide/blob/main/guide/sections/part4/security.adoc

PR in #58


Use a better serialization/deserialization mechanism for data discovery

Describe the bug
Today, MSTest uses the DataContractJsonSerializer serializer in order to perform the serialization and deserialization of the data during discovery and execution.
The problem with current solution is that it requires custom objects to be marked with DataContractAttribute/DataMemberAttribute which isn't what user expects to do or to be doing for the sake of test.
At the moment, the BinaryFormatter seems to be the best option but it's not ideal as this formatter has a lot of security concerns associated (see https://learn.microsoft.com/dotnet/api/system.runtime.serialization.formatters.binary.binaryformatter#remarks)
Additional context
Related issues:

MS Test 2.2.4 - 2.2.10: Tests fail because DynamicData gets only structs with default values (#1094)
wrong value received by test method with ITestDataSource and values of struct with property of nullable primitive type (#1022)
DynamicData test is not passing exception objects correctly (#1037)
Using an interface in dynamic data causes a de-/serialization exception (#908)
DateTime equality test fails after upgrading from 2.2.3 (#1019)
Using dynamic data source method fails to work (#1588)

Is there really any issue with using BinaryFormatter here? The data doesn't cross a security boundary, does it?

Technically I don't see much issues but we would be flagged by internal MS compliance checks + there are many discussions toward removing this formatter in some new version of .NET (nothing acted) so I am not sure if best is to be using that and wait for some "break" to change mechanism.

Given BinaryFormatter Obsoletion Strategy it doesn't seem that using BinaryFormatter would be a good path forward.

How about switching to System.Text.Json based serialization?

I would need to make some tests to see how many issues this would fix. It might also be problematic for .NET fx users.
Having some more experience with mstest, I think that there is no silver bullet solution and I would probably need to check if the data can be serialized (or to be exact if serializing/deserializing data gives me the same data as input) in which case we can "expand" the data otherwise we should not expand and so don't try to serialize/deserialize data.

It might also be problematic for .NET fx users.

To answer that specific thought, it's supported in .net standard 2.0 and v4.6.2
https://www.nuget.org/packages/System.Text.Json/


UI updates

Major Changes

Added descriptions to the flows to provide more context.
Sorted some context providers to improve readability and organization.
Implemented error handling for the entire application to ensure smoother operation.
Added a reset state feature to the application in the event of an error.
Created new UI components for the export and import flows to enhance user experience.
Implemented a feature to automatically remove API keys during the export flow for added security.

Good. We should try to show that something went wrong whenever this code run.

For any generic error, but not the ones that can break the app?

Good. We should try to show that something went wrong whenever this code run.

For any generic error, but not the ones that can break the app?

If this Icon check fails and the node isn't loaded. Maybe we should just show a toast telling that Node X failed to load or something like that.

Good. We should try to show that something went wrong whenever this code run.

For any generic error, but not the ones that can break the app?

If this Icon check fails and the node isn't loaded. Maybe we should just show a toast telling that Node X failed to load or something like that.

right, I think that can be done 😁


Pass the CA root cert into the apiserver

So that the apiserver will perform client cert checks for authorization. Only enable on GCE where
the apiserver is terminating SSL connections from end users.

/cc @lavalamp

@liggitt

FYI this only enables it for GCE and is based on #6190 which was submitted by @liggitt.

@zmerlynn I'd like for this to get in before the 0.16.0 release cut tomorrow if possible. Thanks!

Sorry, was completely offline. Looking now.

LGTM

Thanks for finding!


Imran Turganov, HW1, All done

Put your name into the PR title, please.

Put your name into the PR title, please.

done

ok.


Error creating embedded templates when there are no merge fields

I am seeing the below exception while creating an embedded template using the Java SDK 4.0.3. I see that the request object has "[]" for merge_fields. I this it is because of that. Can you please take a look. I am including screen shots and code snippet from TemplateDraft.java for your reference. I think an empty check on mergeFileds map should fix the issue.
com.hellosign.sdk.HelloSignException: Merge field is missing "name" parameter
	at com.hellosign.sdk.http.HttpClient.validate(HttpClient.java:177)
	at com.hellosign.sdk.http.HttpClient.asJson(HttpClient.java:210)
	at com.hellosign.sdk.HelloSignClient.createEmbeddedTemplateDraft(HelloSignClient.java:939)

PRs are always welcome, hence why this is open source :)

@codesometech Thanks for the screenshots and explanation, seems straightforward enough. I'll see if I can get a patch out in the next few days.

@codesometech Can you take a look at PR #57 and let me know if that will work for you?

@codesometech This has been merged to develop. If you're so inclined, you can check out that branch and build (it will build version 4.0.4-SNAPSHOT) to test. I'll plan to release the official patch bump next week.

@cmpaul Thank you.

@cmpaul I tested this locally and it looks good. Could you please release this.

@codesometech This has been released as v4.0.4. Please update and let me know if you have any issues. Thanks for your help!


Fix publisher capitalization

Refs https://github.com/pulumi/pulumi-dbtcloud/pull/23.

It looks like a slightly better thing to do is to set the homepage to https://pulumi.com

It looks like a slightly better thing to do is to set the homepage to https://pulumi.com
Edit: the URL is already set here, so I guess Java publishing is fine. Well, this repo doesn't seem to have a build.gradle file?

@mikhailshilkov it does but it's not checked in (similar to p-command). Daniel's recent work with versioning probably makes that unnecessary. In any case here's what it looks like:

// *** WARNING: this file was generated by pulumi-java-gen ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

plugins {
    id("signing")
    id("java-library")
    id("maven-publish")
    id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
}

group = "com.pulumi"

def resolvedVersion = System.getenv("PACKAGE_VERSION") ?:
    (project.version == "unspecified"
         ? "1.0.0-alpha.0+dev"
         : project.version)

def signingKey = System.getenv("SIGNING_KEY")
def signingPassword = System.getenv("SIGNING_PASSWORD")
def publishRepoURL = System.getenv("PUBLISH_REPO_URL") ?: "https://s01.oss.sonatype.org"
def publishRepoUsername = System.getenv("PUBLISH_REPO_USERNAME")
def publishRepoPassword = System.getenv("PUBLISH_REPO_PASSWORD")

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(11)
    }
}

compileJava {
    options.fork = true
    options.forkOptions.jvmArgs.addAll(["-Xmx16g"])
    options.encoding = "UTF-8"
}

repositories {
    mavenLocal()
    maven { // The google mirror is less flaky than mavenCentral()
        url("https://maven-central.storage-download.googleapis.com/maven2/")
    }
    mavenCentral()
}

dependencies {
    implementation("com.google.code.findbugs:jsr305:3.0.2")
    implementation("com.google.code.gson:gson:2.8.9")
    implementation("com.pulumi:pulumi:0.9.9")
}

task sourcesJar(type: Jar) {
    from sourceSets.main.allJava
    archiveClassifier.set('sources')
}

task javadocJar(type: Jar) {
    from javadoc
    archiveClassifier.set('javadoc')
    zip64 = true
}

def genPulumiResources = tasks.register('genPulumiResources') {
    doLast {
        def resourcesDir = sourceSets.main.output.resourcesDir
        def subDir = project.name.replace(".", "/")
        def outDir = file("$resourcesDir/$subDir")
        outDir.mkdirs()
        new File(outDir, "version.txt").text = resolvedVersion
        def info = new Object()
        info.metaClass.resource = true
        info.metaClass.name = "docker-build"
        info.metaClass.version = resolvedVersion
        def infoJson = new groovy.json.JsonBuilder(info).toPrettyString()
        new File(outDir, "plugin.json").text = infoJson
    }
}

jar.configure {
    dependsOn genPulumiResources
}

publishing {
    publications {
        mainPublication(MavenPublication) {
            groupId = "com.pulumi"
            artifactId = "docker-build"
            version = resolvedVersion
            from components.java
            artifact sourcesJar
            artifact javadocJar

            pom {
                inceptionYear = "2022"
                name = "pulumi-docker-build"
                packaging = "jar"
                description = "A Pulumi provider for building modern Docker images with buildx and BuildKit."

                url = "https://github.com/pulumi/pulumi-docker-build"

                scm {
                    connection =<EMAIL_ADDRESS>                    developerConnection =<EMAIL_ADDRESS>                    url = "https://github.com/pulumi/pulumi-docker-build"
                }

                licenses {
                    license {
                        name = "The Apache License, Version 2.0"
                        url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
                    }
                }

                developers {
                    developer {
                        id = "pulumi"
                        name = "Pulumi"
                        email =<EMAIL_ADDRESS>                    }
                }
            }
        }
    }
}

javadoc {
    if (JavaVersion.current().isJava9Compatible()) {
        options.addBooleanOption('html5', true)
    }
    options.jFlags("-Xmx8g", "-Xms512m")
}

jar {
    zip64 = true
}

if (publishRepoUsername) {
    nexusPublishing {
        repositories {
            sonatype {
                nexusUrl.set(uri(publishRepoURL + "/service/local/"))
                snapshotRepositoryUrl.set(uri(publishRepoURL + "/content/repositories/snapshots/"))
                username = publishRepoUsername
                password = publishRepoPassword
            }
        }
    }
}

if (signingKey) {
    signing {
        useInMemoryPgpKeys(signingKey, signingPassword)
        sign publishing.publications.mainPublication
    }
}%


Proposal to expose the WebSocket instance from client.ts to the global scope in Vite

Description
When developing a sub-application using single-spa, I would like to use the HMR (Hot Module Replacement) WebSocket instance from Vite to listen for "update" message types. This will help me determine whether I can use the single-spa unloadApplication function to reload the sub-application. However, I haven't found a good solution yet, and I can only write a plugin to replace the code in client.mjs to achieve my goal indirectly.
Suggested solution
Is there a convenient way for developers to access the HMR WebSocket instance? If not, would it be possible to implement this feature in the future?
Thank you!
Alternative
No response
Additional context
No response
Validations

[X] Follow our Code of Conduct
[X] Read the Contributing Guidelines.
[X] Read the docs.
[X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

I guess you can use import.meta.hot.on('vite:beforeUpdate', e => {}).
https://vitejs.dev/guide/api-hmr.html#hot-on-event-cb

I guess you can use import.meta.hot.on('vite:beforeUpdate', e => {}). https://vitejs.dev/guide/api-hmr.html#hot-on-event-cb

Sorry, it's my fault


[Client encryption]: Add baseline benchmarks for Microsoft.Azure.Cosmos.Encryption.Custom

Pull Request Template
Description
Adding a Microsoft.Azure.Cosmos.Encryption.Custom.Performance.Tests with Encrypt/Decrypt benchmarks for different document size. Attaching also initial baseline report with the current memory allocations.
Type of change
Please delete options that are not relevant.

[x] New feature (non-breaking change which adds functionality)

Closing issues
Contributes to #4678

@kirankumarkolli could you have a look, too, please. thanks

/azp run


Fix totalLength interpretation with negative numbers for #425

@all-contributors please add @DamienCassou  for code


SRS/3.0.153 DVR(with mp4) memory leak

描述(Description)
DVR 且使用 mp4 格式時，會導致 memory leak，flv 格式不會

SRS版本(Version): 3.0.153
SRS的日志如下(Log):

==5885== 1,048,576 bytes in 1 blocks are still reachable in loss record 245 of 247
==5885==    at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5885==    by 0x455C99: __gnu_cxx::new_allocator<SrsMp4Sample*>::allocate(unsigned long, void const*) (new_allocator.h:104)
==5885==    by 0x4546E7: __gnu_cxx::__alloc_traits<std::allocator<SrsMp4Sample*> >::allocate(std::allocator<SrsMp4Sample*>&, unsigned long) (alloc_traits.h:182)
==5885==    by 0x45260F: std::_Vector_base<SrsMp4Sample*, std::allocator<SrsMp4Sample*> >::_M_allocate(unsigned long) (stl_vector.h:170)
==5885==    by 0x44E32A: std::vector<SrsMp4Sample*, std::allocator<SrsMp4Sample*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<SrsMp4Sample**, std::vector<SrsMp4Sample*, std::allocator<SrsMp4Sample*> > >, SrsMp4Sample* const&) (vector.tcc:353)
==5885==    by 0x44A181: std::vector<SrsMp4Sample*, std::allocator<SrsMp4Sample*> >::push_back(SrsMp4Sample* const&) (stl_vector.h:925)
==5885==    by 0x43E3FC: SrsMp4SampleManager::append(SrsMp4Sample*) (srs_kernel_mp4.cpp:4812)
==5885==    by 0x442F15: SrsMp4Encoder::write_sample(SrsFormat*, SrsMp4HandlerType, unsigned short, unsigned short, unsigned int, unsigned int, unsigned char*, unsigned int) (srs_kernel_mp4.cpp:5748)
==5885==    by 0x5B5DEF: SrsDvrMp4Segmenter::encode_video(SrsSharedPtrMessage*, SrsFormat*) (srs_app_dvr.cpp:518)
==5885==    by 0x5B3DFE: SrsDvrSegmenter::write_video(SrsSharedPtrMessage*, SrsFormat*) (srs_app_dvr.cpp:161)
==5885==    by 0x5B68EC: SrsDvrPlan::on_video(SrsSharedPtrMessage*, SrsFormat*) (srs_app_dvr.cpp:665)
==5885==    by 0x5B836C: SrsDvr::on_video(SrsSharedPtrMessage*, SrsFormat*) (srs_app_dvr.cpp:1023)
==5885==
==5885== 2,933,856 bytes in 40,748 blocks are still reachable in loss record 246 of 247
==5885==    at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5885==    by 0x442CD3: SrsMp4Encoder::write_sample(SrsFormat*, SrsMp4HandlerType, unsigned short, unsigned short, unsigned int, unsigned int, unsigned char*, unsigned int) (srs_kernel_mp4.cpp:5714)
==5885==    by 0x5B5DEF: SrsDvrMp4Segmenter::encode_video(SrsSharedPtrMessage*, SrsFormat*) (srs_app_dvr.cpp:518)
==5885==    by 0x5B3DFE: SrsDvrSegmenter::write_video(SrsSharedPtrMessage*, SrsFormat*) (srs_app_dvr.cpp:161)
==5885==    by 0x5B68EC: SrsDvrPlan::on_video(SrsSharedPtrMessage*, SrsFormat*) (srs_app_dvr.cpp:665)
==5885==    by 0x5B836C: SrsDvr::on_video(SrsSharedPtrMessage*, SrsFormat*) (srs_app_dvr.cpp:1023)
==5885==    by 0x4DFFC3: SrsOriginHub::on_video(SrsSharedPtrMessage*, bool) (srs_app_source.cpp:1087)
==5885==    by 0x4E5EC8: SrsSource::on_video_imp(SrsSharedPtrMessage*) (srs_app_source.cpp:2303)
==5885==    by 0x4E5B1C: SrsSource::on_video(SrsCommonMessage*) (srs_app_source.cpp:2258)
==5885==    by 0x4D8EEE: SrsRtmpConn::process_publish_message(SrsSource*, SrsCommonMessage*) (srs_app_rtmp_conn.cpp:1021)
==5885==    by 0x4D8D15: SrsRtmpConn::handle_publish_message(SrsSource*, SrsCommonMessage*) (srs_app_rtmp_conn.cpp:993)
==5885==    by 0x580F4F: SrsPublishRecvThread::consume(SrsCommonMessage*) (srs_app_recv_thread.cpp:389)
==5885==
==5885== 4,216,752 bytes in 58,566 blocks are still reachable in loss record 247 of 247
==5885==    at 0x4C2E0EF: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5885==    by 0x442CD3: SrsMp4Encoder::write_sample(SrsFormat*, SrsMp4HandlerType, unsigned short, unsigned short, unsigned int, unsigned int, unsigned char*, unsigned int) (srs_kernel_mp4.cpp:5714)
==5885==    by 0x5B5CC7: SrsDvrMp4Segmenter::encode_audio(SrsSharedPtrMessage*, SrsFormat*) (srs_app_dvr.cpp:492)
==5885==    by 0x5B3C87: SrsDvrSegmenter::write_audio(SrsSharedPtrMessage*, SrsFormat*) (srs_app_dvr.cpp:143)
==5885==    by 0x5B684E: SrsDvrPlan::on_audio(SrsSharedPtrMessage*, SrsFormat*) (srs_app_dvr.cpp:650)
==5885==    by 0x5B8316: SrsDvr::on_audio(SrsSharedPtrMessage*, SrsFormat*) (srs_app_dvr.cpp:1013)
==5885==    by 0x4DF283: SrsOriginHub::on_audio(SrsSharedPtrMessage*) (srs_app_source.cpp:994)
==5885==    by 0x4E56BD: SrsSource::on_audio_imp(SrsSharedPtrMessage*) (srs_app_source.cpp:2188)
==5885==    by 0x4E52C0: SrsSource::on_audio(SrsCommonMessage*) (srs_app_source.cpp:2138)
==5885==    by 0x4D8E6F: SrsRtmpConn::process_publish_message(SrsSource*, SrsCommonMessage*) (srs_app_rtmp_conn.cpp:1014)
==5885==    by 0x4D8D15: SrsRtmpConn::handle_publish_message(SrsSource*, SrsCommonMessage*) (srs_app_rtmp_conn.cpp:993)
==5885==    by 0x580F4F: SrsPublishRecvThread::consume(SrsCommonMessage*) (srs_app_recv_thread.cpp:389)
==5885==
==5885== LEAK SUMMARY:
==5885==    definitely lost: 960 bytes in 18 blocks
==5885==    indirectly lost: 416 bytes in 2 blocks
==5885==      possibly lost: 0 bytes in 0 blocks
==5885==    still reachable: 8,343,274 bytes in 99,590 blocks
==5885==                       of which reachable via heuristic:
==5885==                         multipleinheritance: 40 bytes in 1 blocks
==5885==         suppressed: 0 bytes in 0 blocks
==5885==
==5885== For counts of detected and suppressed errors, rerun with: -v
==5885== Use --track-origins=yes to see where uninitialised values come from
==5885== ERROR SUMMARY: 4676373 errors from 1589 contexts (suppressed: 0 from 0)

SRS的配置如下(Config):
直接使用 conf/dvr.mp4.conf 就能重現

# the config for srs to dvr in session mode
# @see https://github.com/ossrs/srs/wiki/v3_CN_DVR
# @see full.conf for detail config.

listen              1935;
max_connections     1000;
vhost __defaultVhost__ {
    dvr {
        enabled      on;
        dvr_path     ./objs/nginx/html/[app]/[stream].[timestamp].mp4;
        dvr_plan     session;
    }
}

重现(Replay)

透過 vld 跑 srs: valgrind --leak-check=full --error-limit=no --show-reachable=yes ./objs/srs -c conf/dvr.mp4.conf
透過 ffmpeg 推流 (約22分39秒): ffmpeg -re -i ~/test.mp4 -vcodec copy -acodec copy -f flv -y rtmp://<IP_ADDRESS>/app/stream001
推流結束後 15 分鐘結束 srs

期望行为(Expect)

这个要看看。

I confirm the leak in this version. In 20 days, 5 processes (4 * edge + origin) leaked 5.5 gigabytes of RAM slowly.
listen              <IP_ADDRESS>:19350;
max_connections     1000;
daemon              on;
srs_log_tank        file;
srs_log_file        /var/log/srs/origin.log;
pid                 ./objs/origin.pid;
http_api {
    enabled         on;
    listen          <IP_ADDRESS>:9000;
}
vhost __defaultVhost__ {
}

listen              1935;
max_connections     1000;
pid                 ./objs/edge1.pid;
daemon              on;
srs_log_tank        file;
srs_log_file        /var/log/srs/edge1.log;
http_api {
    enabled         on;
    listen          <IP_ADDRESS>:9101;
}
vhost __defaultVhost__ {
    cluster {
        mode            remote;
        origin          <IP_ADDRESS>:19350;
        token_traverse  on;
    }
    http_hooks {
        enabled         on;
        on_publish      http://localhost/srsevent.php?server=edge1;
        on_unpublish    http://localhost/srsevent.php?server=edge1;
        on_play         http://localhost/srsevent.php?server=edge1;
        on_stop         http://localhost/srsevent.php?server=edge1;
    }
}

I confirm the leak in this version. In 20 days, 5 processes (4 * edge + origin) leaked 5.5 gigabytes of RAM slowly.
listen              <IP_ADDRESS>:19350;
max_connections     1000;
daemon              on;
srs_log_tank        file;
srs_log_file        /var/log/srs/origin.log;
pid                 ./objs/origin.pid;
http_api {
    enabled         on;
    listen          <IP_ADDRESS>:9000;
}
vhost __defaultVhost__ {
}

listen              1935;
max_connections     1000;
pid                 ./objs/edge1.pid;
daemon              on;
srs_log_tank        file;
srs_log_file        /var/log/srs/edge1.log;
http_api {
    enabled         on;
    listen          <IP_ADDRESS>:9101;
}
vhost __defaultVhost__ {
    cluster {
        mode            remote;
        origin          <IP_ADDRESS>:19350;
        token_traverse  on;
    }
    http_hooks {
        enabled         on;
        on_publish      http://localhost/srsevent.php?server=edge1;
        on_unpublish    http://localhost/srsevent.php?server=edge1;
        on_play         http://localhost/srsevent.php?server=edge1;
        on_stop         http://localhost/srsevent.php?server=edge1;
    }
}

Current version 3.0.157:
==85952== 343,543 (105,840 direct, 237,703 indirect) bytes in 294 blocks are definitely lost in loss record 437 of 439
==85952==    at 0x4835DEF: operator new(unsigned long) (vg_replace_malloc.c:334)
==85952==    by 0x21B666: SrsBasicRtmpClient::SrsBasicRtmpClient(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long, long) (srs_service_rtmp_conn.cpp:45)
==85952==    by 0x22CF4C: SrsSimpleRtmpClient::SrsSimpleRtmpClient(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long, long) (srs_app_rtmp_conn.cpp:74)
==85952==    by 0x2D0FCF: SrsEdgeRtmpUpstream::connect(SrsRequest*, SrsLbRoundRobin*) (srs_app_edge.cpp:122)
==85952==    by 0x2D1FC3: SrsEdgeIngester::do_cycle() (srs_app_edge.cpp:276)
==85952==    by 0x2D1CC8: SrsEdgeIngester::cycle() (srs_app_edge.cpp:248)
==85952==    by 0x262E91: SrsSTCoroutine::cycle() (srs_app_st.cpp:198)
==85952==    by 0x262F0C: SrsSTCoroutine::pfn(void*) (srs_app_st.cpp:213)
==85952==    by 0x30CF2E: _st_thread_main (sched.c:337)
==85952==    by 0x30D6BE: st_thread_create (sched.c:616)
==85952==
==85952== 917,504 bytes in 7 blocks are still reachable in loss record 438 of 439
==85952==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==85952==    by 0x1EB6D6: SrsFastStream::SrsFastStream(int) (srs_protocol_stream.cpp:63)
==85952==    by 0x1C4158: SrsProtocol::SrsProtocol(ISrsProtocolReadWriter*) (srs_rtmp_stack.cpp:229)
==85952==    by 0x1CA85E: SrsRtmpClient::SrsRtmpClient(ISrsProtocolReadWriter*) (srs_rtmp_stack.cpp:1825)
==85952==    by 0x21BA1D: SrsBasicRtmpClient::connect() (srs_service_rtmp_conn.cpp:69)
==85952==    by 0x2D1011: SrsEdgeRtmpUpstream::connect(SrsRequest*, SrsLbRoundRobin*) (srs_app_edge.cpp:124)
==85952==    by 0x2D1FC3: SrsEdgeIngester::do_cycle() (srs_app_edge.cpp:276)
==85952==    by 0x2D1CC8: SrsEdgeIngester::cycle() (srs_app_edge.cpp:248)
==85952==    by 0x262E91: SrsSTCoroutine::cycle() (srs_app_st.cpp:198)
==85952==    by 0x262F0C: SrsSTCoroutine::pfn(void*) (srs_app_st.cpp:213)
==85952==    by 0x30CF2E: _st_thread_main (sched.c:337)
==85952==    by 0x30D6BE: st_thread_create (sched.c:616)
==85952==
==85952== 1,310,720 bytes in 10 blocks are still reachable in loss record 439 of 439
==85952==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==85952==    by 0x1EB6D6: SrsFastStream::SrsFastStream(int) (srs_protocol_stream.cpp:63)
==85952==    by 0x1C4158: SrsProtocol::SrsProtocol(ISrsProtocolReadWriter*) (srs_rtmp_stack.cpp:229)
==85952==    by 0x1CD0EC: SrsRtmpServer::SrsRtmpServer(ISrsProtocolReadWriter*) (srs_rtmp_stack.cpp:2192)
==85952==    by 0x22D77D: SrsRtmpConn::SrsRtmpConn(SrsServer*, void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (srs_app_rtmp_conn.cpp:111)
==85952==    by 0x228F09: SrsServer::fd2conn(SrsListenerType, void*, SrsConnection**) (srs_app_server.cpp:1449)
==85952==    by 0x228A4A: SrsServer::accept_client(SrsListenerType, void*) (srs_app_server.cpp:1388)
==85952==    by 0x220D16: SrsBufferListener::on_tcp_client(void*) (srs_app_server.cpp:167)
==85952==    by 0x2F0CEA: SrsTcpListener::cycle() (srs_app_listener.cpp:202)
==85952==    by 0x262E91: SrsSTCoroutine::cycle() (srs_app_st.cpp:198)
==85952==    by 0x262F0C: SrsSTCoroutine::pfn(void*) (srs_app_st.cpp:213)
==85952==    by 0x30CF2E: _st_thread_main (sched.c:337)
==85952==
==85952== LEAK SUMMARY:
==85952==    definitely lost: 209,340 bytes in 1,183 blocks
==85952==    indirectly lost: 317,469 bytes in 4,981 blocks
==85952==      possibly lost: 19,564 bytes in 268 blocks
==85952==    still reachable: 3,374,479 bytes in 2,433 blocks
==85952==                       of which reachable via heuristic:
==85952==                         multipleinheritance: 40 bytes in 1 blocks
==85952==         suppressed: 0 bytes in 0 blocks

Current version 3.0.157:
==85952== 343,543 (105,840 direct, 237,703 indirect) bytes in 294 blocks are definitely lost in loss record 437 of 439
==85952==    at 0x4835DEF: operator new(unsigned long) (vg_replace_malloc.c:334)
==85952==    by 0x21B666: SrsBasicRtmpClient::SrsBasicRtmpClient(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long, long) (srs_service_rtmp_conn.cpp:45)
==85952==    by 0x22CF4C: SrsSimpleRtmpClient::SrsSimpleRtmpClient(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, long, long) (srs_app_rtmp_conn.cpp:74)
==85952==    by 0x2D0FCF: SrsEdgeRtmpUpstream::connect(SrsRequest*, SrsLbRoundRobin*) (srs_app_edge.cpp:122)
==85952==    by 0x2D1FC3: SrsEdgeIngester::do_cycle() (srs_app_edge.cpp:276)
==85952==    by 0x2D1CC8: SrsEdgeIngester::cycle() (srs_app_edge.cpp:248)
==85952==    by 0x262E91: SrsSTCoroutine::cycle() (srs_app_st.cpp:198)
==85952==    by 0x262F0C: SrsSTCoroutine::pfn(void*) (srs_app_st.cpp:213)
==85952==    by 0x30CF2E: _st_thread_main (sched.c:337)
==85952==    by 0x30D6BE: st_thread_create (sched.c:616)
==85952==
==85952== 917,504 bytes in 7 blocks are still reachable in loss record 438 of 439
==85952==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==85952==    by 0x1EB6D6: SrsFastStream::SrsFastStream(int) (srs_protocol_stream.cpp:63)
==85952==    by 0x1C4158: SrsProtocol::SrsProtocol(ISrsProtocolReadWriter*) (srs_rtmp_stack.cpp:229)
==85952==    by 0x1CA85E: SrsRtmpClient::SrsRtmpClient(ISrsProtocolReadWriter*) (srs_rtmp_stack.cpp:1825)
==85952==    by 0x21BA1D: SrsBasicRtmpClient::connect() (srs_service_rtmp_conn.cpp:69)
==85952==    by 0x2D1011: SrsEdgeRtmpUpstream::connect(SrsRequest*, SrsLbRoundRobin*) (srs_app_edge.cpp:124)
==85952==    by 0x2D1FC3: SrsEdgeIngester::do_cycle() (srs_app_edge.cpp:276)
==85952==    by 0x2D1CC8: SrsEdgeIngester::cycle() (srs_app_edge.cpp:248)
==85952==    by 0x262E91: SrsSTCoroutine::cycle() (srs_app_st.cpp:198)
==85952==    by 0x262F0C: SrsSTCoroutine::pfn(void*) (srs_app_st.cpp:213)
==85952==    by 0x30CF2E: _st_thread_main (sched.c:337)
==85952==    by 0x30D6BE: st_thread_create (sched.c:616)
==85952==
==85952== 1,310,720 bytes in 10 blocks are still reachable in loss record 439 of 439
==85952==    at 0x483577F: malloc (vg_replace_malloc.c:299)
==85952==    by 0x1EB6D6: SrsFastStream::SrsFastStream(int) (srs_protocol_stream.cpp:63)
==85952==    by 0x1C4158: SrsProtocol::SrsProtocol(ISrsProtocolReadWriter*) (srs_rtmp_stack.cpp:229)
==85952==    by 0x1CD0EC: SrsRtmpServer::SrsRtmpServer(ISrsProtocolReadWriter*) (srs_rtmp_stack.cpp:2192)
==85952==    by 0x22D77D: SrsRtmpConn::SrsRtmpConn(SrsServer*, void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (srs_app_rtmp_conn.cpp:111)
==85952==    by 0x228F09: SrsServer::fd2conn(SrsListenerType, void*, SrsConnection**) (srs_app_server.cpp:1449)
==85952==    by 0x228A4A: SrsServer::accept_client(SrsListenerType, void*) (srs_app_server.cpp:1388)
==85952==    by 0x220D16: SrsBufferListener::on_tcp_client(void*) (srs_app_server.cpp:167)
==85952==    by 0x2F0CEA: SrsTcpListener::cycle() (srs_app_listener.cpp:202)
==85952==    by 0x262E91: SrsSTCoroutine::cycle() (srs_app_st.cpp:198)
==85952==    by 0x262F0C: SrsSTCoroutine::pfn(void*) (srs_app_st.cpp:213)
==85952==    by 0x30CF2E: _st_thread_main (sched.c:337)
==85952==
==85952== LEAK SUMMARY:
==85952==    definitely lost: 209,340 bytes in 1,183 blocks
==85952==    indirectly lost: 317,469 bytes in 4,981 blocks
==85952==      possibly lost: 19,564 bytes in 268 blocks
==85952==    still reachable: 3,374,479 bytes in 2,433 blocks
==85952==                       of which reachable via heuristic:
==85952==                         multipleinheritance: 40 bytes in 1 blocks
==85952==         suppressed: 0 bytes in 0 blocks

https://github.com/ossrs/srs/pull/2138

https://github.com/ossrs/srs/pull/2138

Pull request #2138

https://github.com/ossrs/srs/issues/2606
这个pr已经解决了是吧。麻烦确认一下。


Enforce JWT authentication and roles authorization

[ ] Add role authorization to handle different section by user role
[ ] Use userId from JWT in backend
[ ] Handle menu rendering based on roles

Close in favor of #39


#993 Support broker properties from JSON files

LGTM. btw the image quay.io/artemiscloud/activemq-artemis-broker-kubernetes@sha256:9093e08d49634cb4dae18942dfa2a488f0607eed76fb75890d93914833db9a93 seems gone (deleted?) when I run the tests again.

I updated the related images to 2.37.0 and removed the references to the temporary activemq-artemis-broker-kubernetes container images.

All tests passed.


OpeningHoursPeriodDate.toDateTime() weekday mapping is wrong

The method dayTimeToDateTime in the src/utils.dart expects the given day parameter to have the following mapping:
0 -> Monday
1 -> Tuesday
...
6 -> Sunday
When it actually has the mapping:
0 -> Sunday
1 -> Monday
...
6 -> Saturday
The second mapping is used in the Places API as documented here: https://developers.google.com/maps/documentation/places/web-service/details#PlaceDetailsResults
So currently when running this code:
PlaceDetails placeDetails = ... /* get it from the api */;
OpeningHoursPeriod openingHoursPeriod = placeDetails.openingHours.periods.first;
DateTime wrongDateTime = openingHoursPeriod.open.toDateTime();

Will return a DateTime object which has it's day shifted one day to the future.

If you would change this code:
DateTime dayTimeToDateTime(int day, String time) {
  if (time.length < 4) {
    throw ArgumentError(
        "'time' is not a valid string. It must be four integers.");
  }

  final _now = DateTime.now();
  // Maps is 0-index DO^W
  final _weekday = _now.weekday - 1;
  final _mondayOfThisWeek = _now.day - _weekday;
  final _computedWeekday = _mondayOfThisWeek + day;

  final _hour = int.parse(time.substring(0, 2));
  final _minute = int.parse(time.substring(2));

  return DateTime.utc(_now.year, _now.month, _computedWeekday, _hour, _minute);
}

to this:
DateTime dayTimeToDateTime(int day, String time) {
  if (time.length < 4) {
    throw ArgumentError(
        "'time' is not a valid string. It must be four integers.");
  }

  final _now = DateTime.now();
  // Maps is 0-index DO^W
  final _adjustedDay = day == 0 ? 6 : day - 1;
  final _weekday = _now.weekday - 1;
  final _mondayOfThisWeek = _now.day - _weekday;
  final _computedWeekday = _mondayOfThisWeek + _adjustedDay;

  final _hour = int.parse(time.substring(0, 2));
  final _minute = int.parse(time.substring(2));

  return DateTime.utc(_now.year, _now.month, _computedWeekday, _hour, _minute);
}

everything would work fine.

Thanks for report
Fix landed on 0.0.20-nullsafety.5


Move control server to fastapi again

Not ready to be merged
Revert of https://github.com/basetenlabs/truss/pull/385, with an additional change to have patching logic offloading to the thread executor.
The plan is to test this extensively on development before merging.

closing in favor of https://github.com/basetenlabs/truss/pull/422