Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 09:05
    ViKingQ starred balderdashy/sails
  • 07:16
    AlexShemelin starred balderdashy/sails
  • 06:22
    snowdream1985 starred balderdashy/sails
  • 00:31

    eashaw on master

    0.9.2 (compare)

  • 00:31

    eashaw on v0.9.2

    0.9.2 (compare)

  • 00:30

    eashaw on master

    Update package.json Merge pull request #198 from sa… (compare)

  • 00:30
    eashaw closed #198
  • 00:23

    eashaw on master

    1.5.3 (compare)

  • 00:23

    eashaw on v1.5.3

    1.5.3 (compare)

  • Aug 10 21:15
    eashaw opened #198
  • Aug 10 21:14

    eashaw on update-async

    Update package.json (compare)

  • Aug 10 21:12

    eashaw on master

    upgrade ejs to 3.1.7 (#7243) (compare)

  • Aug 10 21:12
    eashaw closed #7243
  • Aug 10 21:08

    eashaw on master

    Add heading about the __Host- p… (compare)

  • Aug 10 21:08
    eashaw closed #7245
  • Aug 10 21:08
    sailsbot commented #7245
  • Aug 10 21:07
    eashaw opened #7245
  • Aug 10 21:06

    eashaw on docs-add-note-about-cookies

    Add heading about the __Host- p… (compare)

  • Aug 10 21:04

    eashaw on master

    5.0.1 (compare)

  • Aug 10 21:04

    eashaw on v5.0.1

    5.0.1 (compare)

Nguyen Nhan
@nhan.developer_gitlab
can anyone help me?
Chris Unitt
@chrisunitt
hi all, does anyone know how the sails.helpers.stripe.* helpers get included in the template web app? I can see these references but there is no 'stripe' directory or helper in the app source, is there somehow a link created to something inside node_modules?
2 replies
cayledelatorre
@cayledelatorre
Hi. I'm new to sails and I noticed in my MySQL Workbench there are some "sleeping" connections. I think those connections are from .sendNativeQuery(). Is there in any way I could close the connection after using sendNativeQuery()?
1 reply
Laxman Pai
@hondvryer
Hi All, How do I access URL query params inside a controller?
3 replies
Shafqat Ullah Khan
@Shasikhan

when sending multiple requests to server from multiple devices at same time causes following error:
error: Sending 500 ("Server Error") response: { Error: OperationalError [AdapterError]: Unexpected error from database adapter: sendNativeQuery failed ("queryFailed"). The database returned an error when attempting to execute the native query. Additional data:

{ error: TypeError: Cannot read properties of undefined (reading 'on') at E:\DPMS-backend\node_modules\mssql\lib\tedious\request.js:428:20 at E:\DPMS-backend\node_modules\mssql\lib\base\connection-pool.js:100:41 at processTicksAndRejections (node:internal/process/task_queues:96:5) at runNextTicks (node:internal/process/task_queues:65:3) at processImmediate (node:internal/timers:437:9), meta: undefined } at getReports (E:\DPMS-backend\api\controllers\SyncController.ts:186:42) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Object.push [as sync/push] (E:\DPMS-backend\api\controllers\SyncController.ts:689:21) { cause: Error [AdapterError]: Unexpected error from database adapter: sendNativeQuery failed ("queryFailed"). The database returned an error when attempting to execute the native query. Additional data:

{
error: TypeError: Cannot read properties of undefined (reading 'on')
at E:\DPMS-backend\node_modules\mssql\lib\tedious\request.js:428:20
at E:\DPMS-backend\node_modules\mssql\lib\base\connection-pool.js:100:41
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runNextTicks (node:internal/process/task_queues:65:3)
at processImmediate (node:internal/timers:437:9),
meta: undefined
}
at getReports (E:\DPMS-backend\api\controllers\SyncController.ts:186:42)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.push [as sync/push] (E:\DPMS-backend\api\controllers\SyncController.ts:689:21) {
adapterMethodName: 'find',
modelIdentity: 'monitoring',
raw: [Error]
},
isOperational: true,
adapterMethodName: 'find',
modelIdentity: 'monitoring',
raw: Exception: sendNativeQuery failed ("queryFailed"). The database returned an error when attempting to execute the native query.
Additional data:

{
error: TypeError: Cannot read properties of undefined (reading 'on')
at E:\DPMS-backend\node_modules\mssql\lib\tedious\request.js:428:20
at E:\DPMS-backend\node_modules\mssql\lib\base\connection-pool.js:100:41
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runNextTicks (node:internal/process/task_queues:65:3)
at processImmediate (node:internal/timers:437:9),
meta: undefined
}
at Object.connectAndQuery (E:\DPMS-backend\node_modules\sails-mssql\lib\adapter.js:619:69)
at async Object.find (E:\DPMS-backend\node_modules\sails-mssql\lib\adapter.js:647:23) {
code: 'queryFailed',
exit: 'queryFailed',
traceRef: {},
raw: [Object]
}

Greg-J
@Greg-J

I can successfully get the parameters from AWS, but it's an async call and I cannot for the life of me figure out how to set the connection string with the response since there's no await available in config file.

Example:
```// Load the AWS SDK for Node.js
var AWS = require('aws-sdk');

var ssm = new AWS.SSM({region: 'us-east-1'});

var options = {
Name: '/test/test', / required /
WithDecryption: false
};

var parameterPromise = ssm.getParameter(options).promise();

parameterPromise.then(function(data, err) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
```

How can I use this response in the module.exports for the database config?

Алексей Короленко
@krolaxan_twitter
Hi everyone! I want to use several slots in my vue component but it doesn't work for me. I read vue doc and I have seen that it's support only from vue v2.6.0 but my sails project has only vue v2.5.17. How can I update vue version in asset's dependencies or use several slots in one component?
Mirek Kaspar
@kasp1
Looking for someone to help me get started with SailsJS, I'm stuck with tests at the moment but have other general questions... I can offer my knowledge of Vue, Dart/Flutter, Unreal Engine, or cash in exchange. Please PM or email at k@e0.cz if interested. Thanks :-)
Kelvin Oghenerhoro Omereshone
@DominusKelvin

Hey Sails.js family. Sailsconf 2022 is some days away and I'm inviting you all to all the talks and I will be sharing a secret project(s) I have been working on at Sailsconf that will be quite interesting to a lot of folks I am assuming.

https://sailsconf.com

Kelvin Oghenerhoro Omereshone
@DominusKelvin

Hey all, if you want to chat about Sailsconf 2022 or ask questions on the event/sails please kindly join the Sailscasts discord.

https://discord.com/invite/gbJZuNm

gitcommitshow
@gitcommitshow
Does sails and sails-mongo plan to support mongodb server version >4.2 ?
I recently upgraded mongodb server to 4.4 but now that I am checking the mongodb node driver version used in sails-mongo (3.5.x), which does not support mongodb server after 4.2 as per mongodb node driver their compatibilty. what options do I have here to continue using sails?
Kelvin Oghenerhoro Omereshone
@DominusKelvin
Hey all come learn real-world testing from Gustavo in his Sailsconf 2022 talk
https://youtu.be/i4aYlf292aE
Kelvin Oghenerhoro Omereshone
@DominusKelvin
Syed Imran Hasan
@iHasan1
I am trying to use sails-mysql package in my application
when I set migration: drop or alter
I am thrown an authentication error
suggesting that I need to update my SQL updator
if I set migration: safe
the projects starts just fine and connection with db is established easily
adaptor*
Kelvin Oghenerhoro Omereshone
@DominusKelvin
@iHasan1 perhaps you should use sails-sql
https://www.npmjs.com/package/sails-sql
Kelvin Oghenerhoro Omereshone
@DominusKelvin
Kelvin Oghenerhoro Omereshone
@DominusKelvin
Hey everyone. Mike McNeil will be giving his keynote at Sailsconf in a couple of minutes
https://youtu.be/OME5lQUJ4q4
Mike
@_mikeusa_twitter
Have another conference I have to attend. Sorry
Kelvin Oghenerhoro Omereshone
@DominusKelvin
Hey all day 2 of Sailsconf kicking off with a talk on shipping Sails apps via Docker containers
https://youtu.be/4rPnX5EUm7E
Kelvin Oghenerhoro Omereshone
@DominusKelvin

Hey all. It's the last day of Sailsconf. Tune in to some amazing talks

https://youtu.be/i4aYlf292aE

Simon Meer
@si741mee
Sails did not found my js.file and everytime i want to click on the Side, which includes the js.file, i get an error with : Cannot read properties of null (reading 'addEventListener'). Is it possible, that the script is loading faster than the Side?
xziy
@xziy
Hi all! Our team "42pub", just updated sails-adminpanel https://github.com/sails-adminpanel/sails-adminpanel
We integrate vmware clarity ui framework, and rewrite it to TypeScript, now it stable.
Now it's very easy to make an admin panel with Sails.
1 reply
KalindaC
@KalindaC
Hey I am trying to add a custom middleware to check request headers for an API key. When I try to use this method inside config/http.js I can't seem to access the req and res objects.
KalindaC
@KalindaC
apiKey: function(){ res = this.res; req = this.req; console.log("InitializingapiKey(API Key Middleware)") console.log("Checking response for API Key..."); //app.use('*',) return function(req,res,next){ console.log('Received HTTP request:'+req.method+' '+req.path ); if(req.headers['apiKey']!==API_KEY || req.headers['apiKey'] !== '' ){ res.status.status(401).send("UNAUTHORIZED ACCESS!") } else{ res.send(200) }
}
1 reply
dylanusdt
@dylanusdt:matrix.org
[m]
I'll help 10 individuals how to earn $20,000 in just 72 hours from the crypto/forex market. But you will pay me 10% commission when you receive your profit. if interested send me a direct message via Whatapp by asking me HOW for more details on how to get started
+1 (570) 801-0862
Cristian Zoz
@ZoCrit
Hi,
I can't seem to find an answer to this:
I'm using the sails-mysql adapter to connect to my database and I'd like to add a custom method to the waterline ORM that listens for incoming DB queries and calls a callback function when it receives, but if I access the native mysql driver to write the method I can't access the existing DB connection configured in datastores.js and have to create a new one, is there a way to do this but by using the existing connection (as if I were using leaseConnection())?
Mathan Sivavel
@mathansivavel
Hi Guys, I am new to sailsJs, I want to create a multi tenant architecture with sails. for now i can connect to multiple datasources via the native drivers provided by sails and usingconnection method. but when I want to run associations populate method the using connection doesnt work because only one model is connected to the required datasource and others are pointed to the default datasource
1 reply
Stephen
@S-Stephen

Hello, I've been investigating how to expose the Blueprint actions by adding entries in the routes.js. However I'm having a tough time running tests on the destroy and remove actions.
The destroy action just hangs and the remove action complains that:

Error: Missing required route option, `req.options.alias`

my routes.js config is:


  'GET /api/v1/student/:id' : { action: 'student/findOne' },
  'GET /api/v1/student' : { action: 'student/find' },
  // destroying a student is difficult as it has associations!?
  // is this why it hangs?
  'DELETE /api/v1/student/:id' : {action: 'student/destroy'},
  'POST /api/v1/student' : { action: 'student/create'},
  'PATCH /api/v1/student/:id' : {action: 'student/update'},
  // The actions seems to want an alias/?
  'DELETE /api/v1/student/:id/:association/:fk' : { action: 'student/remove'}

and the tests run:

baseurl = '/api/v1/student';

canDeleteStudent = async function (username) {

    var agent = await loginAs(username);
    await agent
        .delete(baseurl + '/1')
        .expect(200);

};
...
canRemoveAssociations = async function (username) {

    var agent = await loginAs(username);
    await agent
        .delete(baseurl + '/1/stuUser/1')
        .expect(200)
        .then(res => {
            console.log(res.body)
        });

};

Anyone got any idea what the problems could be? stuUser is defined as;


    stuUser: {
      model: 'user',
      description: 'The user record relating to this student'
    }
Stephen
@S-Stephen
This page (https://sailsjs.com/documentation/reference/request-req/req-options) eludes to the fact that an extra 'option' must be provided but says little more. Does anyone else know - has used this technique?! Thanks in advance!
Zakarya Alsalahi (Mr.YaYaman)
@hkzak
image.png
Hello everyone! I made a poc using sails and mongodb 3 years and it was parked but now I was trying to start the app up again using sails lift --drop but I am getting this error
{
ok: 0,
errmsg: 'Unsupported OP_QUERY command: drop. The client driver may require an upgrade. For more details see https://dochub.mongodb.org/core/legacy-opcode-removal',
code: 352,
codeName: 'UnsupportedOpQueryCommand'
}
I havent been updated with sails since 2019 so any help would be highly appreciated
Does the sails lift --drop still work ?
Noitidart
@Noitidart
does anyone know where the sails template is for layout.ejs when doing sails new project and picking 1 for web app? i want to create an issue. deleting window.self is causing problems with stripe sdk.
2 replies
Dan
@danLing_93_twitter

Hey, i am using sails js as a framework and I just can not get sessions to work, im using connect-pg-admin, Iv tried every way to connect, pool, conObject and conString but every time it says Failed to prune sessions: relation “session” does not exist.
I have tested the connection by connecting and selecting the table names, and the session table is there. heres an example of the code im using.

const pgPool = new Pool({
  connectionString: ‘<connectionString>’,
  ssl: {
    sslmode: ‘require’,
  }
});
...
...
  session: {
    adapter: ‘connect-pg-simple’,
    store:  new pgSession({
      pool: pgPool,
      tableName: ‘session’
    }),
    secret: ‘shhhhhhh’,
    cookie: {
      secure: true,
      maxAge: 24 * 60 * 60 * 1000,  // 24 hours
    },
    resave: true,
    saveUninitialized: true
  }

any help would be great. Thanks,

1 reply
Dan
@danLing_93_twitter
Still struggling with this, any ideas?
Ryan Emberling
@itsalaidbacklife
I'm having an issue where session data is lost whenever users refresh the page. Has anyone encountered a similar problem? Currently all my requests are made via websockets so I suspect that session key is only being stored in memory in the socket rather than in a cookie
AliVleotsky
@AliVleotsky
trying to get started with sails. got through to sails lift and localhost:1337 but getting "not found" see no error in VSCode terminal.
jaafit
@jaafit

Hi, I'm having an issue with how data is returned by Waterline.

Let's say I have a Posts table and at some endpoints, I need to populate Posts.user but in other endpoints I don't. My front-end now has two possible Post formats: {text: 'the post text', user: 'theuserid1234'} or {text:'the post text', user: {id: 'theuserid1234', name:'John', ...etc}}

So .user might be an id or it might be an object. And when the front-end looks for the id in cached data, it must look in both Post.user and Post.user.id. Is there a place in Sails where I could intercept responses and instead of returning {user:'theuserid1234'} return {user: {id: 'theuserid1234'}}

So that way, the front-end is always looking for the id in post.user.id?

Vladimir Núñez
@black3xp
Hi, how can I ignore escape characters by searching sails?
giang.tranz
@giangtran99
i created new instance sails app and i used loadtest for requesting to default page (localhost:1337) result in memory kept increasing . Is this sailjs bug ?
Phanhieu460
@Phanhieu460
image.png
Hi everyone, I have only started with sails for a few days, I am getting an error when using findOne can someone help me? This is my code
image.png
This is error